diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 107be24..a3b9775 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -25,9 +25,17 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 + - name: Install NDK and CMake + run: | + yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses > /dev/null || true + "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "ndk;26.1.10909125" "cmake;3.22.1" + - name: Build debug APK run: ./gradlew assembleDebug --build-cache --parallel + - name: Unit tests + run: ./gradlew testDebugUnitTest --build-cache --parallel + - name: Upload APK uses: actions/upload-artifact@v4 with: diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a219ce3..9e0c1ab 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,6 +7,7 @@ plugins { android { namespace = "com.sleepy.upscale" compileSdk = 34 + ndkVersion = "26.1.10909125" defaultConfig { applicationId = "com.sleepy.upscale" @@ -14,6 +15,24 @@ android { targetSdk = 34 versionCode = 1 versionName = "1.0.0" + + ndk { + abiFilters += listOf("arm64-v8a", "armeabi-v7a") + } + + externalNativeBuild { + cmake { + arguments += listOf("-DANDROID_STL=c++_static") + cppFlags += listOf("-std=c++17") + } + } + } + + externalNativeBuild { + cmake { + path = file("src/main/cpp/CMakeLists.txt") + version = "3.22.1" + } } buildTypes { @@ -34,6 +53,7 @@ android { buildFeatures { compose = true + buildConfig = true } } @@ -55,6 +75,9 @@ dependencies { implementation(libs.androidx.lifecycle.runtime.ktx) implementation(libs.lifecycle.runtime.compose) implementation(libs.okhttp) + implementation(libs.androidx.exifinterface) + + testImplementation(libs.junit) debugImplementation(libs.compose.ui.tooling) } diff --git a/app/libs/ncnn/VERSION.txt b/app/libs/ncnn/VERSION.txt new file mode 100644 index 0000000..b9ff79c --- /dev/null +++ b/app/libs/ncnn/VERSION.txt @@ -0,0 +1,11 @@ +Vendored ncnn prebuilt Android distribution (static, Vulkan-enabled) + +Version: 20260526 +Source: https://github.com/Tencent/ncnn/releases/download/20260526/ncnn-20260526-android-vulkan.zip +ABIs: arm64-v8a, armeabi-v7a +License: BSD-3-Clause (https://github.com/Tencent/ncnn/blob/master/LICENSE.txt) + +Layout per ABI: + include/ncnn/*.h public headers + lib/*.a libncnn + glslang/SPIRV static libs (runtime shader compilation) + lib/cmake/ exported CMake configs (find_package(ncnn CONFIG)) diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/Include/ResourceLimits.h b/app/libs/ncnn/arm64-v8a/include/glslang/Include/ResourceLimits.h new file mode 100644 index 0000000..b36c8d6 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/Include/ResourceLimits.h @@ -0,0 +1,159 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. +// + +#ifndef _RESOURCE_LIMITS_INCLUDED_ +#define _RESOURCE_LIMITS_INCLUDED_ + +struct TLimits { + bool nonInductiveForLoops; + bool whileLoops; + bool doWhileLoops; + bool generalUniformIndexing; + bool generalAttributeMatrixVectorIndexing; + bool generalVaryingIndexing; + bool generalSamplerIndexing; + bool generalVariableIndexing; + bool generalConstantMatrixVectorIndexing; +}; + +struct TBuiltInResource { + int maxLights; + int maxClipPlanes; + int maxTextureUnits; + int maxTextureCoords; + int maxVertexAttribs; + int maxVertexUniformComponents; + int maxVaryingFloats; + int maxVertexTextureImageUnits; + int maxCombinedTextureImageUnits; + int maxTextureImageUnits; + int maxFragmentUniformComponents; + int maxDrawBuffers; + int maxVertexUniformVectors; + int maxVaryingVectors; + int maxFragmentUniformVectors; + int maxVertexOutputVectors; + int maxFragmentInputVectors; + int minProgramTexelOffset; + int maxProgramTexelOffset; + int maxClipDistances; + int maxComputeWorkGroupCountX; + int maxComputeWorkGroupCountY; + int maxComputeWorkGroupCountZ; + int maxComputeWorkGroupSizeX; + int maxComputeWorkGroupSizeY; + int maxComputeWorkGroupSizeZ; + int maxComputeUniformComponents; + int maxComputeTextureImageUnits; + int maxComputeImageUniforms; + int maxComputeAtomicCounters; + int maxComputeAtomicCounterBuffers; + int maxVaryingComponents; + int maxVertexOutputComponents; + int maxGeometryInputComponents; + int maxGeometryOutputComponents; + int maxFragmentInputComponents; + int maxImageUnits; + int maxCombinedImageUnitsAndFragmentOutputs; + int maxCombinedShaderOutputResources; + int maxImageSamples; + int maxVertexImageUniforms; + int maxTessControlImageUniforms; + int maxTessEvaluationImageUniforms; + int maxGeometryImageUniforms; + int maxFragmentImageUniforms; + int maxCombinedImageUniforms; + int maxGeometryTextureImageUnits; + int maxGeometryOutputVertices; + int maxGeometryTotalOutputComponents; + int maxGeometryUniformComponents; + int maxGeometryVaryingComponents; + int maxTessControlInputComponents; + int maxTessControlOutputComponents; + int maxTessControlTextureImageUnits; + int maxTessControlUniformComponents; + int maxTessControlTotalOutputComponents; + int maxTessEvaluationInputComponents; + int maxTessEvaluationOutputComponents; + int maxTessEvaluationTextureImageUnits; + int maxTessEvaluationUniformComponents; + int maxTessPatchComponents; + int maxPatchVertices; + int maxTessGenLevel; + int maxViewports; + int maxVertexAtomicCounters; + int maxTessControlAtomicCounters; + int maxTessEvaluationAtomicCounters; + int maxGeometryAtomicCounters; + int maxFragmentAtomicCounters; + int maxCombinedAtomicCounters; + int maxAtomicCounterBindings; + int maxVertexAtomicCounterBuffers; + int maxTessControlAtomicCounterBuffers; + int maxTessEvaluationAtomicCounterBuffers; + int maxGeometryAtomicCounterBuffers; + int maxFragmentAtomicCounterBuffers; + int maxCombinedAtomicCounterBuffers; + int maxAtomicCounterBufferSize; + int maxTransformFeedbackBuffers; + int maxTransformFeedbackInterleavedComponents; + int maxCullDistances; + int maxCombinedClipAndCullDistances; + int maxSamples; + int maxMeshOutputVerticesNV; + int maxMeshOutputPrimitivesNV; + int maxMeshWorkGroupSizeX_NV; + int maxMeshWorkGroupSizeY_NV; + int maxMeshWorkGroupSizeZ_NV; + int maxTaskWorkGroupSizeX_NV; + int maxTaskWorkGroupSizeY_NV; + int maxTaskWorkGroupSizeZ_NV; + int maxMeshViewCountNV; + int maxMeshOutputVerticesEXT; + int maxMeshOutputPrimitivesEXT; + int maxMeshWorkGroupSizeX_EXT; + int maxMeshWorkGroupSizeY_EXT; + int maxMeshWorkGroupSizeZ_EXT; + int maxTaskWorkGroupSizeX_EXT; + int maxTaskWorkGroupSizeY_EXT; + int maxTaskWorkGroupSizeZ_EXT; + int maxMeshViewCountEXT; + int maxDualSourceDrawBuffersEXT; + + TLimits limits; +}; + +#endif // _RESOURCE_LIMITS_INCLUDED_ diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/Include/glslang_c_interface.h b/app/libs/ncnn/arm64-v8a/include/glslang/Include/glslang_c_interface.h new file mode 100644 index 0000000..4eec55b --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/Include/glslang_c_interface.h @@ -0,0 +1,299 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +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. +**/ + +#ifndef GLSLANG_C_IFACE_H_INCLUDED +#define GLSLANG_C_IFACE_H_INCLUDED + +#include +#include + +#include "glslang_c_shader_types.h" +#include "visibility.h" + +typedef struct glslang_shader_s glslang_shader_t; +typedef struct glslang_program_s glslang_program_t; +typedef struct glslang_mapper_s glslang_mapper_t; +typedef struct glslang_resolver_s glslang_resolver_t; + +/* Version counterpart */ +typedef struct glslang_version_s { + int major; + int minor; + int patch; + const char* flavor; +} glslang_version_t; + +/* TLimits counterpart */ +typedef struct glslang_limits_s { + bool non_inductive_for_loops; + bool while_loops; + bool do_while_loops; + bool general_uniform_indexing; + bool general_attribute_matrix_vector_indexing; + bool general_varying_indexing; + bool general_sampler_indexing; + bool general_variable_indexing; + bool general_constant_matrix_vector_indexing; +} glslang_limits_t; + +/* TBuiltInResource counterpart */ +typedef struct glslang_resource_s { + int max_lights; + int max_clip_planes; + int max_texture_units; + int max_texture_coords; + int max_vertex_attribs; + int max_vertex_uniform_components; + int max_varying_floats; + int max_vertex_texture_image_units; + int max_combined_texture_image_units; + int max_texture_image_units; + int max_fragment_uniform_components; + int max_draw_buffers; + int max_vertex_uniform_vectors; + int max_varying_vectors; + int max_fragment_uniform_vectors; + int max_vertex_output_vectors; + int max_fragment_input_vectors; + int min_program_texel_offset; + int max_program_texel_offset; + int max_clip_distances; + int max_compute_work_group_count_x; + int max_compute_work_group_count_y; + int max_compute_work_group_count_z; + int max_compute_work_group_size_x; + int max_compute_work_group_size_y; + int max_compute_work_group_size_z; + int max_compute_uniform_components; + int max_compute_texture_image_units; + int max_compute_image_uniforms; + int max_compute_atomic_counters; + int max_compute_atomic_counter_buffers; + int max_varying_components; + int max_vertex_output_components; + int max_geometry_input_components; + int max_geometry_output_components; + int max_fragment_input_components; + int max_image_units; + int max_combined_image_units_and_fragment_outputs; + int max_combined_shader_output_resources; + int max_image_samples; + int max_vertex_image_uniforms; + int max_tess_control_image_uniforms; + int max_tess_evaluation_image_uniforms; + int max_geometry_image_uniforms; + int max_fragment_image_uniforms; + int max_combined_image_uniforms; + int max_geometry_texture_image_units; + int max_geometry_output_vertices; + int max_geometry_total_output_components; + int max_geometry_uniform_components; + int max_geometry_varying_components; + int max_tess_control_input_components; + int max_tess_control_output_components; + int max_tess_control_texture_image_units; + int max_tess_control_uniform_components; + int max_tess_control_total_output_components; + int max_tess_evaluation_input_components; + int max_tess_evaluation_output_components; + int max_tess_evaluation_texture_image_units; + int max_tess_evaluation_uniform_components; + int max_tess_patch_components; + int max_patch_vertices; + int max_tess_gen_level; + int max_viewports; + int max_vertex_atomic_counters; + int max_tess_control_atomic_counters; + int max_tess_evaluation_atomic_counters; + int max_geometry_atomic_counters; + int max_fragment_atomic_counters; + int max_combined_atomic_counters; + int max_atomic_counter_bindings; + int max_vertex_atomic_counter_buffers; + int max_tess_control_atomic_counter_buffers; + int max_tess_evaluation_atomic_counter_buffers; + int max_geometry_atomic_counter_buffers; + int max_fragment_atomic_counter_buffers; + int max_combined_atomic_counter_buffers; + int max_atomic_counter_buffer_size; + int max_transform_feedback_buffers; + int max_transform_feedback_interleaved_components; + int max_cull_distances; + int max_combined_clip_and_cull_distances; + int max_samples; + int max_mesh_output_vertices_nv; + int max_mesh_output_primitives_nv; + int max_mesh_work_group_size_x_nv; + int max_mesh_work_group_size_y_nv; + int max_mesh_work_group_size_z_nv; + int max_task_work_group_size_x_nv; + int max_task_work_group_size_y_nv; + int max_task_work_group_size_z_nv; + int max_mesh_view_count_nv; + int max_mesh_output_vertices_ext; + int max_mesh_output_primitives_ext; + int max_mesh_work_group_size_x_ext; + int max_mesh_work_group_size_y_ext; + int max_mesh_work_group_size_z_ext; + int max_task_work_group_size_x_ext; + int max_task_work_group_size_y_ext; + int max_task_work_group_size_z_ext; + int max_mesh_view_count_ext; + union + { + int max_dual_source_draw_buffers_ext; + + /* Incorrectly capitalized name retained for backward compatibility */ + int maxDualSourceDrawBuffersEXT; + }; + + glslang_limits_t limits; +} glslang_resource_t; + +/* Inclusion result structure allocated by C include_local/include_system callbacks */ +typedef struct glsl_include_result_s { + /* Header file name or NULL if inclusion failed */ + const char* header_name; + + /* Header contents or NULL */ + const char* header_data; + size_t header_length; + +} glsl_include_result_t; + +/* Callback for local file inclusion */ +typedef glsl_include_result_t* (*glsl_include_local_func)(void* ctx, const char* header_name, const char* includer_name, + size_t include_depth); + +/* Callback for system file inclusion */ +typedef glsl_include_result_t* (*glsl_include_system_func)(void* ctx, const char* header_name, + const char* includer_name, size_t include_depth); + +/* Callback for include result destruction */ +typedef int (*glsl_free_include_result_func)(void* ctx, glsl_include_result_t* result); + +/* Collection of callbacks for GLSL preprocessor */ +typedef struct glsl_include_callbacks_s { + glsl_include_system_func include_system; + glsl_include_local_func include_local; + glsl_free_include_result_func free_include_result; +} glsl_include_callbacks_t; + +typedef struct glslang_input_s { + glslang_source_t language; + glslang_stage_t stage; + glslang_client_t client; + glslang_target_client_version_t client_version; + glslang_target_language_t target_language; + glslang_target_language_version_t target_language_version; + /** Shader source code */ + const char* code; + int default_version; + glslang_profile_t default_profile; + int force_default_version_and_profile; + int forward_compatible; + glslang_messages_t messages; + const glslang_resource_t* resource; + glsl_include_callbacks_t callbacks; + void* callbacks_ctx; +} glslang_input_t; + +/* SpvOptions counterpart */ +typedef struct glslang_spv_options_s { + bool generate_debug_info; + bool strip_debug_info; + bool disable_optimizer; + bool optimize_size; + bool disassemble; + bool validate; + bool emit_nonsemantic_shader_debug_info; + bool emit_nonsemantic_shader_debug_source; + bool compile_only; + bool optimize_allow_expanded_id_bound; +} glslang_spv_options_t; + +#ifdef __cplusplus +extern "C" { +#endif + +GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version); + +GLSLANG_EXPORT int glslang_initialize_process(void); +GLSLANG_EXPORT void glslang_finalize_process(void); + +GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input); +GLSLANG_EXPORT void glslang_shader_delete(glslang_shader_t* shader); +GLSLANG_EXPORT void glslang_shader_set_preamble(glslang_shader_t* shader, const char* s); +GLSLANG_EXPORT void glslang_shader_set_entry_point(glslang_shader_t* shader, const char* s); +GLSLANG_EXPORT void glslang_shader_set_invert_y(glslang_shader_t* shader, bool y); +GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base); +GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set); +GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options); // glslang_shader_options_t +GLSLANG_EXPORT void glslang_shader_set_glsl_version(glslang_shader_t* shader, int version); +GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_set_and_binding(glslang_shader_t* shader, unsigned int set, unsigned int binding); +GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_name(glslang_shader_t* shader, const char *name); +GLSLANG_EXPORT void glslang_shader_set_resource_set_binding(glslang_shader_t* shader, const char *const *bindings, unsigned int num_bindings); +GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input); +GLSLANG_EXPORT int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input); +GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader); +GLSLANG_EXPORT void glslang_shader_set_preprocessed_code(glslang_shader_t* shader, const char* code); +GLSLANG_EXPORT const char* glslang_shader_get_info_log(glslang_shader_t* shader); +GLSLANG_EXPORT const char* glslang_shader_get_info_debug_log(glslang_shader_t* shader); + +GLSLANG_EXPORT glslang_program_t* glslang_program_create(void); +GLSLANG_EXPORT void glslang_program_delete(glslang_program_t* program); +GLSLANG_EXPORT void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader); +GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages); // glslang_messages_t +GLSLANG_EXPORT void glslang_program_add_source_text(glslang_program_t* program, glslang_stage_t stage, const char* text, size_t len); +GLSLANG_EXPORT void glslang_program_set_source_file(glslang_program_t* program, glslang_stage_t stage, const char* file); +GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program); +GLSLANG_EXPORT int glslang_program_map_io_with_resolver_and_mapper(glslang_program_t* program, glslang_resolver_t* resolver, glslang_mapper_t* mapper); +GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage); +GLSLANG_EXPORT void glslang_program_SPIRV_generate_with_options(glslang_program_t* program, glslang_stage_t stage, glslang_spv_options_t* spv_options); +GLSLANG_EXPORT size_t glslang_program_SPIRV_get_size(glslang_program_t* program); +GLSLANG_EXPORT void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int*); +GLSLANG_EXPORT unsigned int* glslang_program_SPIRV_get_ptr(glslang_program_t* program); +GLSLANG_EXPORT const char* glslang_program_SPIRV_get_messages(glslang_program_t* program); +GLSLANG_EXPORT const char* glslang_program_get_info_log(glslang_program_t* program); +GLSLANG_EXPORT const char* glslang_program_get_info_debug_log(glslang_program_t* program); + +GLSLANG_EXPORT glslang_mapper_t* glslang_glsl_mapper_create(void); +GLSLANG_EXPORT void glslang_glsl_mapper_delete(glslang_mapper_t* mapper); + +GLSLANG_EXPORT glslang_resolver_t* glslang_glsl_resolver_create(glslang_program_t* program, glslang_stage_t stage); +GLSLANG_EXPORT void glslang_glsl_resolver_delete(glslang_resolver_t* resolver); + +#ifdef __cplusplus +} +#endif + +#endif /* #ifdef GLSLANG_C_IFACE_INCLUDED */ diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/Include/glslang_c_shader_types.h b/app/libs/ncnn/arm64-v8a/include/glslang/Include/glslang_c_shader_types.h new file mode 100644 index 0000000..ccba2fd --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/Include/glslang_c_shader_types.h @@ -0,0 +1,235 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +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. +**/ + +#ifndef C_SHADER_TYPES_H_INCLUDED +#define C_SHADER_TYPES_H_INCLUDED + +#define LAST_ELEMENT_MARKER(x) x + +/* EShLanguage counterpart */ +typedef enum { + GLSLANG_STAGE_VERTEX, + GLSLANG_STAGE_TESSCONTROL, + GLSLANG_STAGE_TESSEVALUATION, + GLSLANG_STAGE_GEOMETRY, + GLSLANG_STAGE_FRAGMENT, + GLSLANG_STAGE_COMPUTE, + GLSLANG_STAGE_RAYGEN, + GLSLANG_STAGE_RAYGEN_NV = GLSLANG_STAGE_RAYGEN, + GLSLANG_STAGE_INTERSECT, + GLSLANG_STAGE_INTERSECT_NV = GLSLANG_STAGE_INTERSECT, + GLSLANG_STAGE_ANYHIT, + GLSLANG_STAGE_ANYHIT_NV = GLSLANG_STAGE_ANYHIT, + GLSLANG_STAGE_CLOSESTHIT, + GLSLANG_STAGE_CLOSESTHIT_NV = GLSLANG_STAGE_CLOSESTHIT, + GLSLANG_STAGE_MISS, + GLSLANG_STAGE_MISS_NV = GLSLANG_STAGE_MISS, + GLSLANG_STAGE_CALLABLE, + GLSLANG_STAGE_CALLABLE_NV = GLSLANG_STAGE_CALLABLE, + GLSLANG_STAGE_TASK, + GLSLANG_STAGE_TASK_NV = GLSLANG_STAGE_TASK, + GLSLANG_STAGE_MESH, + GLSLANG_STAGE_MESH_NV = GLSLANG_STAGE_MESH, + LAST_ELEMENT_MARKER(GLSLANG_STAGE_COUNT), +} glslang_stage_t; // would be better as stage, but this is ancient now + +/* EShLanguageMask counterpart */ +typedef enum { + GLSLANG_STAGE_VERTEX_MASK = (1 << GLSLANG_STAGE_VERTEX), + GLSLANG_STAGE_TESSCONTROL_MASK = (1 << GLSLANG_STAGE_TESSCONTROL), + GLSLANG_STAGE_TESSEVALUATION_MASK = (1 << GLSLANG_STAGE_TESSEVALUATION), + GLSLANG_STAGE_GEOMETRY_MASK = (1 << GLSLANG_STAGE_GEOMETRY), + GLSLANG_STAGE_FRAGMENT_MASK = (1 << GLSLANG_STAGE_FRAGMENT), + GLSLANG_STAGE_COMPUTE_MASK = (1 << GLSLANG_STAGE_COMPUTE), + GLSLANG_STAGE_RAYGEN_MASK = (1 << GLSLANG_STAGE_RAYGEN), + GLSLANG_STAGE_RAYGEN_NV_MASK = GLSLANG_STAGE_RAYGEN_MASK, + GLSLANG_STAGE_INTERSECT_MASK = (1 << GLSLANG_STAGE_INTERSECT), + GLSLANG_STAGE_INTERSECT_NV_MASK = GLSLANG_STAGE_INTERSECT_MASK, + GLSLANG_STAGE_ANYHIT_MASK = (1 << GLSLANG_STAGE_ANYHIT), + GLSLANG_STAGE_ANYHIT_NV_MASK = GLSLANG_STAGE_ANYHIT_MASK, + GLSLANG_STAGE_CLOSESTHIT_MASK = (1 << GLSLANG_STAGE_CLOSESTHIT), + GLSLANG_STAGE_CLOSESTHIT_NV_MASK = GLSLANG_STAGE_CLOSESTHIT_MASK, + GLSLANG_STAGE_MISS_MASK = (1 << GLSLANG_STAGE_MISS), + GLSLANG_STAGE_MISS_NV_MASK = GLSLANG_STAGE_MISS_MASK, + GLSLANG_STAGE_CALLABLE_MASK = (1 << GLSLANG_STAGE_CALLABLE), + GLSLANG_STAGE_CALLABLE_NV_MASK = GLSLANG_STAGE_CALLABLE_MASK, + GLSLANG_STAGE_TASK_MASK = (1 << GLSLANG_STAGE_TASK), + GLSLANG_STAGE_TASK_NV_MASK = GLSLANG_STAGE_TASK_MASK, + GLSLANG_STAGE_MESH_MASK = (1 << GLSLANG_STAGE_MESH), + GLSLANG_STAGE_MESH_NV_MASK = GLSLANG_STAGE_MESH_MASK, + LAST_ELEMENT_MARKER(GLSLANG_STAGE_MASK_COUNT), +} glslang_stage_mask_t; + +/* EShSource counterpart */ +typedef enum { + GLSLANG_SOURCE_NONE, + GLSLANG_SOURCE_GLSL, + GLSLANG_SOURCE_HLSL, + LAST_ELEMENT_MARKER(GLSLANG_SOURCE_COUNT), +} glslang_source_t; + +/* EShClient counterpart */ +typedef enum { + GLSLANG_CLIENT_NONE, + GLSLANG_CLIENT_VULKAN, + GLSLANG_CLIENT_OPENGL, + LAST_ELEMENT_MARKER(GLSLANG_CLIENT_COUNT), +} glslang_client_t; + +/* EShTargetLanguage counterpart */ +typedef enum { + GLSLANG_TARGET_NONE, + GLSLANG_TARGET_SPV, + LAST_ELEMENT_MARKER(GLSLANG_TARGET_COUNT), +} glslang_target_language_t; + +/* SH_TARGET_ClientVersion counterpart */ +typedef enum { + GLSLANG_TARGET_VULKAN_1_0 = (1 << 22), + GLSLANG_TARGET_VULKAN_1_1 = (1 << 22) | (1 << 12), + GLSLANG_TARGET_VULKAN_1_2 = (1 << 22) | (2 << 12), + GLSLANG_TARGET_VULKAN_1_3 = (1 << 22) | (3 << 12), + GLSLANG_TARGET_VULKAN_1_4 = (1 << 22) | (4 << 12), + GLSLANG_TARGET_OPENGL_450 = 450, + LAST_ELEMENT_MARKER(GLSLANG_TARGET_CLIENT_VERSION_COUNT = 6), +} glslang_target_client_version_t; + +/* SH_TARGET_LanguageVersion counterpart */ +typedef enum { + GLSLANG_TARGET_SPV_1_0 = (1 << 16), + GLSLANG_TARGET_SPV_1_1 = (1 << 16) | (1 << 8), + GLSLANG_TARGET_SPV_1_2 = (1 << 16) | (2 << 8), + GLSLANG_TARGET_SPV_1_3 = (1 << 16) | (3 << 8), + GLSLANG_TARGET_SPV_1_4 = (1 << 16) | (4 << 8), + GLSLANG_TARGET_SPV_1_5 = (1 << 16) | (5 << 8), + GLSLANG_TARGET_SPV_1_6 = (1 << 16) | (6 << 8), + LAST_ELEMENT_MARKER(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT = 7), +} glslang_target_language_version_t; + +/* EShExecutable counterpart */ +typedef enum { GLSLANG_EX_VERTEX_FRAGMENT, GLSLANG_EX_FRAGMENT } glslang_executable_t; + +// EShOptimizationLevel counterpart +// This enum is not used in the current C interface, but could be added at a later date. +// GLSLANG_OPT_NONE is the current default. +typedef enum { + GLSLANG_OPT_NO_GENERATION, + GLSLANG_OPT_NONE, + GLSLANG_OPT_SIMPLE, + GLSLANG_OPT_FULL, + LAST_ELEMENT_MARKER(GLSLANG_OPT_LEVEL_COUNT), +} glslang_optimization_level_t; + +/* EShTextureSamplerTransformMode counterpart */ +typedef enum { + GLSLANG_TEX_SAMP_TRANS_KEEP, + GLSLANG_TEX_SAMP_TRANS_UPGRADE_TEXTURE_REMOVE_SAMPLER, + LAST_ELEMENT_MARKER(GLSLANG_TEX_SAMP_TRANS_COUNT), +} glslang_texture_sampler_transform_mode_t; + +/* EShMessages counterpart */ +typedef enum { + GLSLANG_MSG_DEFAULT_BIT = 0, + GLSLANG_MSG_RELAXED_ERRORS_BIT = (1 << 0), + GLSLANG_MSG_SUPPRESS_WARNINGS_BIT = (1 << 1), + GLSLANG_MSG_AST_BIT = (1 << 2), + GLSLANG_MSG_SPV_RULES_BIT = (1 << 3), + GLSLANG_MSG_VULKAN_RULES_BIT = (1 << 4), + GLSLANG_MSG_ONLY_PREPROCESSOR_BIT = (1 << 5), + GLSLANG_MSG_READ_HLSL_BIT = (1 << 6), + GLSLANG_MSG_CASCADING_ERRORS_BIT = (1 << 7), + GLSLANG_MSG_KEEP_UNCALLED_BIT = (1 << 8), + GLSLANG_MSG_HLSL_OFFSETS_BIT = (1 << 9), + GLSLANG_MSG_DEBUG_INFO_BIT = (1 << 10), + GLSLANG_MSG_HLSL_ENABLE_16BIT_TYPES_BIT = (1 << 11), + GLSLANG_MSG_HLSL_LEGALIZATION_BIT = (1 << 12), + GLSLANG_MSG_HLSL_DX9_COMPATIBLE_BIT = (1 << 13), + GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT = (1 << 14), + GLSLANG_MSG_ENHANCED = (1 << 15), + GLSLANG_MSG_ABSOLUTE_PATH = (1 << 16), + GLSLANG_MSG_DISPLAY_ERROR_COLUMN = (1 << 17), + GLSLANG_MSG_LINK_TIME_OPTIMIZATION_BIT = (1 << 18), + GLSLANG_MSG_VALIDATE_CROSS_STAGE_IO_BIT = (1 << 19), + LAST_ELEMENT_MARKER(GLSLANG_MSG_COUNT), +} glslang_messages_t; + +/* EShReflectionOptions counterpart */ +typedef enum { + GLSLANG_REFLECTION_DEFAULT_BIT = 0, + GLSLANG_REFLECTION_STRICT_ARRAY_SUFFIX_BIT = (1 << 0), + GLSLANG_REFLECTION_BASIC_ARRAY_SUFFIX_BIT = (1 << 1), + GLSLANG_REFLECTION_INTERMEDIATE_IOO_BIT = (1 << 2), + GLSLANG_REFLECTION_SEPARATE_BUFFERS_BIT = (1 << 3), + GLSLANG_REFLECTION_ALL_BLOCK_VARIABLES_BIT = (1 << 4), + GLSLANG_REFLECTION_UNWRAP_IO_BLOCKS_BIT = (1 << 5), + GLSLANG_REFLECTION_ALL_IO_VARIABLES_BIT = (1 << 6), + GLSLANG_REFLECTION_SHARED_STD140_SSBO_BIT = (1 << 7), + GLSLANG_REFLECTION_SHARED_STD140_UBO_BIT = (1 << 8), + LAST_ELEMENT_MARKER(GLSLANG_REFLECTION_COUNT), +} glslang_reflection_options_t; + +/* EProfile counterpart (from Versions.h) */ +typedef enum { + GLSLANG_BAD_PROFILE = 0, + GLSLANG_NO_PROFILE = (1 << 0), + GLSLANG_CORE_PROFILE = (1 << 1), + GLSLANG_COMPATIBILITY_PROFILE = (1 << 2), + GLSLANG_ES_PROFILE = (1 << 3), + LAST_ELEMENT_MARKER(GLSLANG_PROFILE_COUNT), +} glslang_profile_t; + +/* Shader options */ +typedef enum { + GLSLANG_SHADER_DEFAULT_BIT = 0, + GLSLANG_SHADER_AUTO_MAP_BINDINGS = (1 << 0), + GLSLANG_SHADER_AUTO_MAP_LOCATIONS = (1 << 1), + GLSLANG_SHADER_VULKAN_RULES_RELAXED = (1 << 2), + LAST_ELEMENT_MARKER(GLSLANG_SHADER_COUNT), +} glslang_shader_options_t; + +/* TResourceType counterpart */ +typedef enum { + GLSLANG_RESOURCE_TYPE_SAMPLER, + GLSLANG_RESOURCE_TYPE_TEXTURE, + GLSLANG_RESOURCE_TYPE_IMAGE, + GLSLANG_RESOURCE_TYPE_UBO, + GLSLANG_RESOURCE_TYPE_SSBO, + GLSLANG_RESOURCE_TYPE_UAV, + GLSLANG_RESOURCE_TYPE_COMBINED_SAMPLER, + GLSLANG_RESOURCE_TYPE_AS, + GLSLANG_RESOURCE_TYPE_TENSOR, + LAST_ELEMENT_MARKER(GLSLANG_RESOURCE_TYPE_COUNT), +} glslang_resource_type_t; + +#undef LAST_ELEMENT_MARKER + +#endif diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/Include/visibility.h b/app/libs/ncnn/arm64-v8a/include/glslang/Include/visibility.h new file mode 100644 index 0000000..dd32351 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/Include/visibility.h @@ -0,0 +1,58 @@ +// +// Copyright (C) 2023 LunarG, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. +// +#ifdef GLSLANG_IS_SHARED_LIBRARY + #ifdef _WIN32 + #ifdef GLSLANG_EXPORTING + #define GLSLANG_EXPORT __declspec(dllexport) + #else + #define GLSLANG_EXPORT __declspec(dllimport) + #endif + #elif __GNUC__ >= 4 + #define GLSLANG_EXPORT __attribute__((visibility("default"))) + #endif +#endif // GLSLANG_IS_SHARED_LIBRARY + +#ifndef GLSLANG_EXPORT +#define GLSLANG_EXPORT +#endif + +// Symbols marked with this macro are only meant for public use by the test suite +// and do not appear in publicly installed headers. They are not considered to be +// part of the glslang library ABI. +#ifdef GLSLANG_TEST_BUILD + #define GLSLANG_EXPORT_FOR_TESTS GLSLANG_EXPORT +#else + #define GLSLANG_EXPORT_FOR_TESTS +#endif diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/MachineIndependent/Versions.h b/app/libs/ncnn/arm64-v8a/include/glslang/MachineIndependent/Versions.h new file mode 100644 index 0000000..76f4256 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/MachineIndependent/Versions.h @@ -0,0 +1,412 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017, 2022-2024 Arm Limited. +// Copyright (C) 2015-2018 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// Modifications Copyright (C) 2024 Valve Corporation. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. +// + +#ifndef _VERSIONS_INCLUDED_ +#define _VERSIONS_INCLUDED_ + +#define LAST_ELEMENT_MARKER(x) x + +// +// Help manage multiple profiles, versions, extensions etc. +// + +// +// Profiles are set up for masking operations, so queries can be done on multiple +// profiles at the same time. +// +// Don't maintain an ordinal set of enums (0,1,2,3...) to avoid all possible +// defects from mixing the two different forms. +// +typedef enum : unsigned { + EBadProfile = 0, + ENoProfile = (1 << 0), // only for desktop, before profiles showed up + ECoreProfile = (1 << 1), + ECompatibilityProfile = (1 << 2), + EEsProfile = (1 << 3), + LAST_ELEMENT_MARKER(EProfileCount), +} EProfile; + +namespace glslang { + +// +// Map from profile enum to externally readable text name. +// +inline const char* ProfileName(EProfile profile) +{ + switch (profile) { + case ENoProfile: return "none"; + case ECoreProfile: return "core"; + case ECompatibilityProfile: return "compatibility"; + case EEsProfile: return "es"; + default: return "unknown profile"; + } +} + +// +// What source rules, validation rules, target language, etc. are needed or +// desired for SPIR-V? +// +// 0 means a target or rule set is not enabled (ignore rules from that entity). +// Non-0 means to apply semantic rules arising from that version of its rule set. +// The union of all requested rule sets will be applied. +// +struct SpvVersion { + SpvVersion() : spv(0), vulkanGlsl(0), vulkan(0), openGl(0), vulkanRelaxed(false) {} + unsigned int spv; // the version of SPIR-V to target, as defined by "word 1" of the SPIR-V binary header + int vulkanGlsl; // the version of GLSL semantics for Vulkan, from GL_KHR_vulkan_glsl, for "#define VULKAN XXX" + int vulkan; // the version of Vulkan, for which SPIR-V execution environment rules to use + int openGl; // the version of GLSL semantics for OpenGL, from GL_ARB_gl_spirv, for "#define GL_SPIRV XXX" + bool vulkanRelaxed; // relax changes to GLSL for Vulkan, allowing some GL-specific to be compiled to Vulkan SPIR-V target +}; + +// +// The behaviors from the GLSL "#extension extension_name : behavior" +// +typedef enum { + EBhMissing = 0, + EBhRequire, + EBhEnable, + EBhWarn, + EBhDisable, + EBhDisablePartial // use as initial state of an extension that is only partially implemented +} TExtensionBehavior; + +// +// Symbolic names for extensions. Strings may be directly used when calling the +// functions, but better to have the compiler do spelling checks. +// +const char* const E_GL_OES_texture_3D = "GL_OES_texture_3D"; +const char* const E_GL_OES_standard_derivatives = "GL_OES_standard_derivatives"; +const char* const E_GL_EXT_frag_depth = "GL_EXT_frag_depth"; +const char* const E_GL_OES_EGL_image_external = "GL_OES_EGL_image_external"; +const char* const E_GL_OES_EGL_image_external_essl3 = "GL_OES_EGL_image_external_essl3"; +const char* const E_GL_EXT_YUV_target = "GL_EXT_YUV_target"; +const char* const E_GL_EXT_shader_texture_lod = "GL_EXT_shader_texture_lod"; +const char* const E_GL_EXT_shadow_samplers = "GL_EXT_shadow_samplers"; + +const char* const E_GL_ARB_texture_rectangle = "GL_ARB_texture_rectangle"; +const char* const E_GL_3DL_array_objects = "GL_3DL_array_objects"; +const char* const E_GL_ARB_shading_language_420pack = "GL_ARB_shading_language_420pack"; +const char* const E_GL_ARB_texture_gather = "GL_ARB_texture_gather"; +const char* const E_GL_ARB_gpu_shader5 = "GL_ARB_gpu_shader5"; +const char* const E_GL_ARB_separate_shader_objects = "GL_ARB_separate_shader_objects"; +const char* const E_GL_ARB_compute_shader = "GL_ARB_compute_shader"; +const char* const E_GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader"; +const char* const E_GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layouts"; +const char* const E_GL_ARB_texture_cube_map_array = "GL_ARB_texture_cube_map_array"; +const char* const E_GL_ARB_texture_multisample = "GL_ARB_texture_multisample"; +const char* const E_GL_ARB_shader_texture_lod = "GL_ARB_shader_texture_lod"; +const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location"; +const char* const E_GL_ARB_explicit_uniform_location = "GL_ARB_explicit_uniform_location"; +const char* const E_GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store"; +const char* const E_GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters"; +const char* const E_GL_ARB_shader_atomic_counter_ops = "GL_ARB_shader_atomic_counter_ops"; +const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_parameters"; +const char* const E_GL_ARB_shader_group_vote = "GL_ARB_shader_group_vote"; +const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control"; +const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples"; +const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array"; +const char* const E_GL_ARB_gpu_shader_int64 = "GL_ARB_gpu_shader_int64"; +const char* const E_GL_ARB_gpu_shader_fp64 = "GL_ARB_gpu_shader_fp64"; +const char* const E_GL_ARB_shader_ballot = "GL_ARB_shader_ballot"; +const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2"; +const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp"; +const char* const E_GL_ARB_shader_stencil_export = "GL_ARB_shader_stencil_export"; +// const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members +const char* const E_GL_ARB_post_depth_coverage = "GL_ARB_post_depth_coverage"; +const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewport_layer_array"; +const char* const E_GL_ARB_fragment_shader_interlock = "GL_ARB_fragment_shader_interlock"; +const char* const E_GL_ARB_shader_clock = "GL_ARB_shader_clock"; +const char* const E_GL_ARB_uniform_buffer_object = "GL_ARB_uniform_buffer_object"; +const char* const E_GL_ARB_sample_shading = "GL_ARB_sample_shading"; +const char* const E_GL_ARB_shader_bit_encoding = "GL_ARB_shader_bit_encoding"; +const char* const E_GL_ARB_shader_image_size = "GL_ARB_shader_image_size"; +const char* const E_GL_ARB_shader_storage_buffer_object = "GL_ARB_shader_storage_buffer_object"; +const char* const E_GL_ARB_shading_language_packing = "GL_ARB_shading_language_packing"; +const char* const E_GL_ARB_texture_query_lod = "GL_ARB_texture_query_lod"; +const char* const E_GL_ARB_vertex_attrib_64bit = "GL_ARB_vertex_attrib_64bit"; +const char* const E_GL_ARB_draw_instanced = "GL_ARB_draw_instanced"; +const char* const E_GL_ARB_fragment_coord_conventions = "GL_ARB_fragment_coord_conventions"; +const char* const E_GL_ARB_bindless_texture = "GL_ARB_bindless_texture"; +const char* const E_GL_ARB_conservative_depth = "GL_ARB_conservative_depth"; + +const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic"; +const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote"; +const char* const E_GL_KHR_shader_subgroup_arithmetic = "GL_KHR_shader_subgroup_arithmetic"; +const char* const E_GL_KHR_shader_subgroup_ballot = "GL_KHR_shader_subgroup_ballot"; +const char* const E_GL_KHR_shader_subgroup_shuffle = "GL_KHR_shader_subgroup_shuffle"; +const char* const E_GL_KHR_shader_subgroup_shuffle_relative = "GL_KHR_shader_subgroup_shuffle_relative"; +const char* const E_GL_KHR_shader_subgroup_rotate = "GL_KHR_shader_subgroup_rotate"; +const char* const E_GL_KHR_shader_subgroup_clustered = "GL_KHR_shader_subgroup_clustered"; +const char* const E_GL_KHR_shader_subgroup_quad = "GL_KHR_shader_subgroup_quad"; +const char* const E_GL_KHR_memory_scope_semantics = "GL_KHR_memory_scope_semantics"; +const char* const E_GL_KHR_cooperative_matrix = "GL_KHR_cooperative_matrix"; + +const char* const E_GL_EXT_shader_atomic_int64 = "GL_EXT_shader_atomic_int64"; + +const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers"; +const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_load_formatted"; + +const char* const E_GL_EXT_shader_16bit_storage = "GL_EXT_shader_16bit_storage"; +const char* const E_GL_EXT_shader_8bit_storage = "GL_EXT_shader_8bit_storage"; + + +// EXT extensions +const char* const E_GL_EXT_device_group = "GL_EXT_device_group"; +const char* const E_GL_EXT_multiview = "GL_EXT_multiview"; +const char* const E_GL_EXT_post_depth_coverage = "GL_EXT_post_depth_coverage"; +const char* const E_GL_EXT_control_flow_attributes = "GL_EXT_control_flow_attributes"; +const char* const E_GL_EXT_nonuniform_qualifier = "GL_EXT_nonuniform_qualifier"; +const char* const E_GL_EXT_samplerless_texture_functions = "GL_EXT_samplerless_texture_functions"; +const char* const E_GL_EXT_scalar_block_layout = "GL_EXT_scalar_block_layout"; +const char* const E_GL_EXT_fragment_invocation_density = "GL_EXT_fragment_invocation_density"; +const char* const E_GL_EXT_buffer_reference = "GL_EXT_buffer_reference"; +const char* const E_GL_EXT_buffer_reference2 = "GL_EXT_buffer_reference2"; +const char* const E_GL_EXT_buffer_reference_uvec2 = "GL_EXT_buffer_reference_uvec2"; +const char* const E_GL_EXT_demote_to_helper_invocation = "GL_EXT_demote_to_helper_invocation"; +const char* const E_GL_EXT_shader_realtime_clock = "GL_EXT_shader_realtime_clock"; +const char* const E_GL_EXT_debug_printf = "GL_EXT_debug_printf"; +const char* const E_GL_EXT_ray_tracing = "GL_EXT_ray_tracing"; +const char* const E_GL_EXT_ray_query = "GL_EXT_ray_query"; +const char* const E_GL_EXT_ray_flags_primitive_culling = "GL_EXT_ray_flags_primitive_culling"; +const char* const E_GL_EXT_ray_cull_mask = "GL_EXT_ray_cull_mask"; +const char* const E_GL_EXT_blend_func_extended = "GL_EXT_blend_func_extended"; +const char* const E_GL_EXT_shader_implicit_conversions = "GL_EXT_shader_implicit_conversions"; +const char* const E_GL_EXT_fragment_shading_rate = "GL_EXT_fragment_shading_rate"; +const char* const E_GL_EXT_shader_image_int64 = "GL_EXT_shader_image_int64"; +const char* const E_GL_EXT_null_initializer = "GL_EXT_null_initializer"; +const char* const E_GL_EXT_shared_memory_block = "GL_EXT_shared_memory_block"; +const char* const E_GL_EXT_subgroup_uniform_control_flow = "GL_EXT_subgroup_uniform_control_flow"; +const char* const E_GL_EXT_spirv_intrinsics = "GL_EXT_spirv_intrinsics"; +const char* const E_GL_EXT_fragment_shader_barycentric = "GL_EXT_fragment_shader_barycentric"; +const char* const E_GL_EXT_mesh_shader = "GL_EXT_mesh_shader"; +const char* const E_GL_EXT_opacity_micromap = "GL_EXT_opacity_micromap"; +const char* const E_GL_EXT_shader_quad_control = "GL_EXT_shader_quad_control"; +const char* const E_GL_EXT_draw_instanced = "GL_EXT_draw_instanced"; +const char* const E_GL_EXT_texture_array = "GL_EXT_texture_array"; +const char* const E_GL_EXT_maximal_reconvergence = "GL_EXT_maximal_reconvergence"; +const char* const E_GL_EXT_expect_assume = "GL_EXT_expect_assume"; +const char* const E_GL_EXT_control_flow_attributes2 = "GL_EXT_control_flow_attributes2"; +const char* const E_GL_EXT_spec_constant_composites = "GL_EXT_spec_constant_composites"; +const char* const E_GL_EXT_texture_offset_non_const = "GL_EXT_texture_offset_non_const"; +const char* const E_GL_EXT_nontemporal_keyword = "GL_EXT_nontemporal_keyword"; +const char* const E_GL_EXT_uniform_buffer_unsized_array = "GL_EXT_uniform_buffer_unsized_array"; +const char* const E_GL_EXT_conservative_depth = "GL_EXT_conservative_depth"; + +// Arrays of extensions for the above viewportEXTs duplications + +const char* const post_depth_coverageEXTs[] = { E_GL_ARB_post_depth_coverage, E_GL_EXT_post_depth_coverage }; +const int Num_post_depth_coverageEXTs = sizeof(post_depth_coverageEXTs) / sizeof(post_depth_coverageEXTs[0]); + +// Array of extensions to cover both extensions providing ray tracing capabilities. +const char* const ray_tracing_EXTs[] = { E_GL_EXT_ray_query, E_GL_EXT_ray_tracing }; +const int Num_ray_tracing_EXTs = sizeof(ray_tracing_EXTs) / sizeof(ray_tracing_EXTs[0]); + +// OVR extensions +const char* const E_GL_OVR_multiview = "GL_OVR_multiview"; +const char* const E_GL_OVR_multiview2 = "GL_OVR_multiview2"; + +const char* const OVR_multiview_EXTs[] = { E_GL_OVR_multiview, E_GL_OVR_multiview2 }; +const int Num_OVR_multiview_EXTs = sizeof(OVR_multiview_EXTs) / sizeof(OVR_multiview_EXTs[0]); + +// #line and #include +const char* const E_GL_GOOGLE_cpp_style_line_directive = "GL_GOOGLE_cpp_style_line_directive"; +const char* const E_GL_GOOGLE_include_directive = "GL_GOOGLE_include_directive"; +const char* const E_GL_ARB_shading_language_include = "GL_ARB_shading_language_include"; + +const char* const E_GL_AMD_shader_ballot = "GL_AMD_shader_ballot"; +const char* const E_GL_AMD_shader_trinary_minmax = "GL_AMD_shader_trinary_minmax"; +const char* const E_GL_AMD_shader_explicit_vertex_parameter = "GL_AMD_shader_explicit_vertex_parameter"; +const char* const E_GL_AMD_gcn_shader = "GL_AMD_gcn_shader"; +const char* const E_GL_AMD_gpu_shader_half_float = "GL_AMD_gpu_shader_half_float"; +const char* const E_GL_AMD_texture_gather_bias_lod = "GL_AMD_texture_gather_bias_lod"; +const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_shader_int16"; +const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod"; +const char* const E_GL_AMD_shader_fragment_mask = "GL_AMD_shader_fragment_mask"; +const char* const E_GL_AMD_gpu_shader_half_float_fetch = "GL_AMD_gpu_shader_half_float_fetch"; +const char* const E_GL_AMD_shader_early_and_late_fragment_tests = "GL_AMD_shader_early_and_late_fragment_tests"; + +const char* const E_GL_INTEL_shader_integer_functions2 = "GL_INTEL_shader_integer_functions2"; + +const char* const E_GL_NV_sample_mask_override_coverage = "GL_NV_sample_mask_override_coverage"; +const char* const E_SPV_NV_geometry_shader_passthrough = "GL_NV_geometry_shader_passthrough"; +const char* const E_GL_NV_viewport_array2 = "GL_NV_viewport_array2"; +const char* const E_GL_NV_stereo_view_rendering = "GL_NV_stereo_view_rendering"; +const char* const E_GL_NVX_multiview_per_view_attributes = "GL_NVX_multiview_per_view_attributes"; +const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_atomic_int64"; +const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation"; +const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_noperspective_interpolation"; +const char* const E_GL_NV_shader_subgroup_partitioned = "GL_NV_shader_subgroup_partitioned"; +const char* const E_GL_NV_shading_rate_image = "GL_NV_shading_rate_image"; +const char* const E_GL_NV_ray_tracing = "GL_NV_ray_tracing"; +const char* const E_GL_NV_ray_tracing_motion_blur = "GL_NV_ray_tracing_motion_blur"; +const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragment_shader_barycentric"; +const char* const E_GL_NV_compute_shader_derivatives = "GL_NV_compute_shader_derivatives"; +const char* const E_GL_NV_shader_texture_footprint = "GL_NV_shader_texture_footprint"; +const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_shader"; +const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix"; +const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins"; +const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix"; +const char* const E_GL_NV_shader_invocation_reorder = "GL_NV_shader_invocation_reorder"; +const char* const E_GL_EXT_ray_tracing_position_fetch = "GL_EXT_ray_tracing_position_fetch"; +const char* const E_GL_NV_displacement_micromap = "GL_NV_displacement_micromap"; +const char* const E_GL_NV_shader_atomic_fp16_vector = "GL_NV_shader_atomic_fp16_vector"; +const char* const E_GL_NV_cooperative_matrix2 = "GL_NV_cooperative_matrix2"; +const char* const E_GL_NV_cooperative_vector = "GL_NV_cooperative_vector"; +const char* const E_GL_NV_cluster_acceleration_structure = "GL_NV_cluster_acceleration_structure"; +const char* const E_GL_NV_linear_swept_spheres = "GL_NV_linear_swept_spheres"; +const char* const E_GL_NV_gpu_shader5 = "GL_NV_gpu_shader5"; + +// ARM +const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader_core_builtins"; +const char* const E_GL_ARM_tensors = "GL_ARM_tensors"; + +// Arrays of extensions for the above viewportEXTs duplications + +const char* const viewportEXTs[] = { E_GL_ARB_shader_viewport_layer_array, E_GL_NV_viewport_array2 }; +const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]); + + +const char* const E_GL_QCOM_image_processing = "GL_QCOM_image_processing"; +const char* const E_GL_QCOM_image_processing2 = "GL_QCOM_image_processing2"; +const char* const E_GL_QCOM_tile_shading = "GL_QCOM_tile_shading"; +const char* const E_GL_QCOM_cooperative_matrix_conversion = "GL_QCOM_cooperative_matrix_conversion"; + +// AEP +const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a"; +const char* const E_GL_KHR_blend_equation_advanced = "GL_KHR_blend_equation_advanced"; +const char* const E_GL_OES_sample_variables = "GL_OES_sample_variables"; +const char* const E_GL_OES_shader_image_atomic = "GL_OES_shader_image_atomic"; +const char* const E_GL_OES_shader_multisample_interpolation = "GL_OES_shader_multisample_interpolation"; +const char* const E_GL_OES_texture_storage_multisample_2d_array = "GL_OES_texture_storage_multisample_2d_array"; +const char* const E_GL_EXT_geometry_shader = "GL_EXT_geometry_shader"; +const char* const E_GL_EXT_geometry_point_size = "GL_EXT_geometry_point_size"; +const char* const E_GL_EXT_gpu_shader5 = "GL_EXT_gpu_shader5"; +const char* const E_GL_EXT_primitive_bounding_box = "GL_EXT_primitive_bounding_box"; +const char* const E_GL_EXT_shader_io_blocks = "GL_EXT_shader_io_blocks"; +const char* const E_GL_EXT_tessellation_shader = "GL_EXT_tessellation_shader"; +const char* const E_GL_EXT_tessellation_point_size = "GL_EXT_tessellation_point_size"; +const char* const E_GL_EXT_texture_buffer = "GL_EXT_texture_buffer"; +const char* const E_GL_EXT_texture_cube_map_array = "GL_EXT_texture_cube_map_array"; +const char* const E_GL_EXT_shader_integer_mix = "GL_EXT_shader_integer_mix"; + +// OES matching AEP +const char* const E_GL_OES_geometry_shader = "GL_OES_geometry_shader"; +const char* const E_GL_OES_geometry_point_size = "GL_OES_geometry_point_size"; +const char* const E_GL_OES_gpu_shader5 = "GL_OES_gpu_shader5"; +const char* const E_GL_OES_primitive_bounding_box = "GL_OES_primitive_bounding_box"; +const char* const E_GL_OES_shader_io_blocks = "GL_OES_shader_io_blocks"; +const char* const E_GL_OES_tessellation_shader = "GL_OES_tessellation_shader"; +const char* const E_GL_OES_tessellation_point_size = "GL_OES_tessellation_point_size"; +const char* const E_GL_OES_texture_buffer = "GL_OES_texture_buffer"; +const char* const E_GL_OES_texture_cube_map_array = "GL_OES_texture_cube_map_array"; + +// EXT +const char* const E_GL_EXT_shader_explicit_arithmetic_types = "GL_EXT_shader_explicit_arithmetic_types"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int8 = "GL_EXT_shader_explicit_arithmetic_types_int8"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int16 = "GL_EXT_shader_explicit_arithmetic_types_int16"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int32 = "GL_EXT_shader_explicit_arithmetic_types_int32"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int64 = "GL_EXT_shader_explicit_arithmetic_types_int64"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float16 = "GL_EXT_shader_explicit_arithmetic_types_float16"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float32 = "GL_EXT_shader_explicit_arithmetic_types_float32"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float64 = "GL_EXT_shader_explicit_arithmetic_types_float64"; + +const char* const E_GL_EXT_shader_subgroup_extended_types_int8 = "GL_EXT_shader_subgroup_extended_types_int8"; +const char* const E_GL_EXT_shader_subgroup_extended_types_int16 = "GL_EXT_shader_subgroup_extended_types_int16"; +const char* const E_GL_EXT_shader_subgroup_extended_types_int64 = "GL_EXT_shader_subgroup_extended_types_int64"; +const char* const E_GL_EXT_shader_subgroup_extended_types_float16 = "GL_EXT_shader_subgroup_extended_types_float16"; +const char* const E_GL_EXT_terminate_invocation = "GL_EXT_terminate_invocation"; + +const char* const E_GL_EXT_shader_atomic_float = "GL_EXT_shader_atomic_float"; +const char* const E_GL_EXT_shader_atomic_float2 = "GL_EXT_shader_atomic_float2"; + +const char* const E_GL_EXT_shader_tile_image = "GL_EXT_shader_tile_image"; + +const char* const E_GL_EXT_texture_shadow_lod = "GL_EXT_texture_shadow_lod"; + +const char* const E_GL_EXT_integer_dot_product = "GL_EXT_integer_dot_product"; + +const char* const E_GL_EXT_bfloat16 = "GL_EXT_bfloat16"; +const char* const E_GL_EXT_float_e5m2 = "GL_EXT_float_e5m2"; +const char* const E_GL_EXT_float_e4m3 = "GL_EXT_float_e4m3"; +const char* const E_GL_EXT_long_vector = "GL_EXT_long_vector"; + +const char* const E_GL_EXT_shader_64bit_indexing = "GL_EXT_shader_64bit_indexing"; + +const char* const E_GL_EXT_shader_invocation_reorder = "GL_EXT_shader_invocation_reorder"; + +// Arrays of extensions for the above AEP duplications + +const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader }; +const int Num_AEP_geometry_shader = sizeof(AEP_geometry_shader)/sizeof(AEP_geometry_shader[0]); + +const char* const AEP_geometry_point_size[] = { E_GL_EXT_geometry_point_size, E_GL_OES_geometry_point_size }; +const int Num_AEP_geometry_point_size = sizeof(AEP_geometry_point_size)/sizeof(AEP_geometry_point_size[0]); + +const char* const AEP_gpu_shader5[] = { E_GL_EXT_gpu_shader5, E_GL_OES_gpu_shader5 }; +const int Num_AEP_gpu_shader5 = sizeof(AEP_gpu_shader5)/sizeof(AEP_gpu_shader5[0]); + +const char* const AEP_core_gpu_shader5[] = { E_GL_ARB_gpu_shader5, E_GL_NV_gpu_shader5}; +const int Num_AEP_core_gpu_shader5 = sizeof(AEP_core_gpu_shader5)/sizeof(AEP_core_gpu_shader5[0]); + +const char* const AEP_primitive_bounding_box[] = { E_GL_EXT_primitive_bounding_box, E_GL_OES_primitive_bounding_box }; +const int Num_AEP_primitive_bounding_box = sizeof(AEP_primitive_bounding_box)/sizeof(AEP_primitive_bounding_box[0]); + +const char* const AEP_shader_io_blocks[] = { E_GL_EXT_shader_io_blocks, E_GL_OES_shader_io_blocks }; +const int Num_AEP_shader_io_blocks = sizeof(AEP_shader_io_blocks)/sizeof(AEP_shader_io_blocks[0]); + +const char* const AEP_tessellation_shader[] = { E_GL_EXT_tessellation_shader, E_GL_OES_tessellation_shader }; +const int Num_AEP_tessellation_shader = sizeof(AEP_tessellation_shader)/sizeof(AEP_tessellation_shader[0]); + +const char* const AEP_tessellation_point_size[] = { E_GL_EXT_tessellation_point_size, E_GL_OES_tessellation_point_size }; +const int Num_AEP_tessellation_point_size = sizeof(AEP_tessellation_point_size)/sizeof(AEP_tessellation_point_size[0]); + +const char* const AEP_texture_buffer[] = { E_GL_EXT_texture_buffer, E_GL_OES_texture_buffer }; +const int Num_AEP_texture_buffer = sizeof(AEP_texture_buffer)/sizeof(AEP_texture_buffer[0]); + +const char* const AEP_texture_cube_map_array[] = { E_GL_EXT_texture_cube_map_array, E_GL_OES_texture_cube_map_array }; +const int Num_AEP_texture_cube_map_array = sizeof(AEP_texture_cube_map_array)/sizeof(AEP_texture_cube_map_array[0]); + +const char* const AEP_mesh_shader[] = { E_GL_NV_mesh_shader, E_GL_EXT_mesh_shader }; +const int Num_AEP_mesh_shader = sizeof(AEP_mesh_shader)/sizeof(AEP_mesh_shader[0]); + +} // end namespace glslang + +#endif // _VERSIONS_INCLUDED_ diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/Public/ResourceLimits.h b/app/libs/ncnn/arm64-v8a/include/glslang/Public/ResourceLimits.h new file mode 100644 index 0000000..8245e12 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/Public/ResourceLimits.h @@ -0,0 +1,58 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of Google Inc. 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 HOLDERS 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. + +#ifndef _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ +#define _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ + +#include + +#include "../Include/ResourceLimits.h" +#include "../Include/visibility.h" + +// Return pointer to user-writable Resource to pass through API in +// future-proof way. +GLSLANG_EXPORT extern TBuiltInResource* GetResources(); + +// These are the default resources for TBuiltInResources, used for both +// - parsing this string for the case where the user didn't supply one, +// - dumping out a template for user construction of a config file. +GLSLANG_EXPORT extern const TBuiltInResource* GetDefaultResources(); + +// Returns the DefaultTBuiltInResource as a human-readable string. +GLSLANG_EXPORT std::string GetDefaultTBuiltInResourceString(); + +// Decodes the resource limits from |config| to |resources|. +GLSLANG_EXPORT void DecodeResourceLimits(TBuiltInResource* resources, char* config); + +#endif // _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/Public/ShaderLang.h b/app/libs/ncnn/arm64-v8a/include/glslang/Public/ShaderLang.h new file mode 100644 index 0000000..8ca4ed9 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/Public/ShaderLang.h @@ -0,0 +1,1012 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. +// +#ifndef _COMPILER_INTERFACE_INCLUDED_ +#define _COMPILER_INTERFACE_INCLUDED_ + +#include "../Include/ResourceLimits.h" +#include "../Include/visibility.h" +#include "../MachineIndependent/Versions.h" + +#include +#include + +#ifdef _WIN32 + #define C_DECL __cdecl +#else + #define C_DECL +#endif + +// +// This is the platform independent interface between an OGL driver +// and the shading language compiler/linker. +// + +#ifdef __cplusplus + extern "C" { +#endif + +// +// Call before doing any other compiler/linker operations. +// +// (Call once per process, not once per thread.) +// +GLSLANG_EXPORT int ShInitialize(); + +// +// Call this at process shutdown to clean up memory. +// +GLSLANG_EXPORT int ShFinalize(); + +// +// Types of languages the compiler can consume. +// +typedef enum { + EShLangVertex, + EShLangTessControl, + EShLangTessEvaluation, + EShLangGeometry, + EShLangFragment, + EShLangCompute, + EShLangRayGen, + EShLangRayGenNV = EShLangRayGen, + EShLangIntersect, + EShLangIntersectNV = EShLangIntersect, + EShLangAnyHit, + EShLangAnyHitNV = EShLangAnyHit, + EShLangClosestHit, + EShLangClosestHitNV = EShLangClosestHit, + EShLangMiss, + EShLangMissNV = EShLangMiss, + EShLangCallable, + EShLangCallableNV = EShLangCallable, + EShLangTask, + EShLangTaskNV = EShLangTask, + EShLangMesh, + EShLangMeshNV = EShLangMesh, + LAST_ELEMENT_MARKER(EShLangCount), +} EShLanguage; // would be better as stage, but this is ancient now + +typedef enum : unsigned { + EShLangVertexMask = (1 << EShLangVertex), + EShLangTessControlMask = (1 << EShLangTessControl), + EShLangTessEvaluationMask = (1 << EShLangTessEvaluation), + EShLangGeometryMask = (1 << EShLangGeometry), + EShLangFragmentMask = (1 << EShLangFragment), + EShLangComputeMask = (1 << EShLangCompute), + EShLangRayGenMask = (1 << EShLangRayGen), + EShLangRayGenNVMask = EShLangRayGenMask, + EShLangIntersectMask = (1 << EShLangIntersect), + EShLangIntersectNVMask = EShLangIntersectMask, + EShLangAnyHitMask = (1 << EShLangAnyHit), + EShLangAnyHitNVMask = EShLangAnyHitMask, + EShLangClosestHitMask = (1 << EShLangClosestHit), + EShLangClosestHitNVMask = EShLangClosestHitMask, + EShLangMissMask = (1 << EShLangMiss), + EShLangMissNVMask = EShLangMissMask, + EShLangCallableMask = (1 << EShLangCallable), + EShLangCallableNVMask = EShLangCallableMask, + EShLangTaskMask = (1 << EShLangTask), + EShLangTaskNVMask = EShLangTaskMask, + EShLangMeshMask = (1 << EShLangMesh), + EShLangMeshNVMask = EShLangMeshMask, + LAST_ELEMENT_MARKER(EShLanguageMaskCount), +} EShLanguageMask; + +namespace glslang { + +class TType; + +typedef enum { + EShSourceNone, + EShSourceGlsl, // GLSL, includes ESSL (OpenGL ES GLSL) + EShSourceHlsl, // HLSL + LAST_ELEMENT_MARKER(EShSourceCount), +} EShSource; // if EShLanguage were EShStage, this could be EShLanguage instead + +typedef enum { + EShClientNone, // use when there is no client, e.g. for validation + EShClientVulkan, // as GLSL dialect, specifies KHR_vulkan_glsl extension + EShClientOpenGL, // as GLSL dialect, specifies ARB_gl_spirv extension + LAST_ELEMENT_MARKER(EShClientCount), +} EShClient; + +typedef enum { + EShTargetNone, + EShTargetSpv, // SPIR-V (preferred spelling) + EshTargetSpv = EShTargetSpv, // legacy spelling + LAST_ELEMENT_MARKER(EShTargetCount), +} EShTargetLanguage; + +typedef enum { + EShTargetVulkan_1_0 = (1 << 22), // Vulkan 1.0 + EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), // Vulkan 1.1 + EShTargetVulkan_1_2 = (1 << 22) | (2 << 12), // Vulkan 1.2 + EShTargetVulkan_1_3 = (1 << 22) | (3 << 12), // Vulkan 1.3 + EShTargetVulkan_1_4 = (1 << 22) | (4 << 12), // Vulkan 1.4 + EShTargetOpenGL_450 = 450, // OpenGL + LAST_ELEMENT_MARKER(EShTargetClientVersionCount = 6), +} EShTargetClientVersion; + +typedef EShTargetClientVersion EshTargetClientVersion; + +typedef enum { + EShTargetSpv_1_0 = (1 << 16), // SPIR-V 1.0 + EShTargetSpv_1_1 = (1 << 16) | (1 << 8), // SPIR-V 1.1 + EShTargetSpv_1_2 = (1 << 16) | (2 << 8), // SPIR-V 1.2 + EShTargetSpv_1_3 = (1 << 16) | (3 << 8), // SPIR-V 1.3 + EShTargetSpv_1_4 = (1 << 16) | (4 << 8), // SPIR-V 1.4 + EShTargetSpv_1_5 = (1 << 16) | (5 << 8), // SPIR-V 1.5 + EShTargetSpv_1_6 = (1 << 16) | (6 << 8), // SPIR-V 1.6 + LAST_ELEMENT_MARKER(EShTargetLanguageVersionCount = 7), +} EShTargetLanguageVersion; + +// +// Following are a series of helper enums for managing layouts and qualifiers, +// used for TPublicType, TType, others. +// + +enum TLayoutPacking { + ElpNone, + ElpShared, // default, but different than saying nothing + ElpStd140, + ElpStd430, + ElpPacked, + ElpScalar, + ElpCount // If expanding, see bitfield width below +}; + +struct TInputLanguage { + EShSource languageFamily; // redundant information with other input, this one overrides when not EShSourceNone + EShLanguage stage; // redundant information with other input, this one overrides when not EShSourceNone + EShClient dialect; + int dialectVersion; // version of client's language definition, not the client (when not EShClientNone) + bool vulkanRulesRelaxed; +}; + +struct TClient { + EShClient client; + EShTargetClientVersion version; // version of client itself (not the client's input dialect) +}; + +struct TTarget { + EShTargetLanguage language; + EShTargetLanguageVersion version; // version to target, if SPIR-V, defined by "word 1" of the SPIR-V header + bool hlslFunctionality1; // can target hlsl_functionality1 extension(s) +}; + +// All source/client/target versions and settings. +// Can override previous methods of setting, when items are set here. +// Expected to grow, as more are added, rather than growing parameter lists. +struct TEnvironment { + TInputLanguage input; // definition of the input language + TClient client; // what client is the overall compilation being done for? + TTarget target; // what to generate +}; + +GLSLANG_EXPORT const char* StageName(EShLanguage); + +} // end namespace glslang + +// +// Types of output the linker will create. +// +typedef enum { + EShExVertexFragment, + EShExFragment +} EShExecutable; + +// +// Optimization level for the compiler. +// +typedef enum { + EShOptNoGeneration, + EShOptNone, + EShOptSimple, // Optimizations that can be done quickly + EShOptFull, // Optimizations that will take more time + LAST_ELEMENT_MARKER(EshOptLevelCount), +} EShOptimizationLevel; + +// +// Texture and Sampler transformation mode. +// +typedef enum { + EShTexSampTransKeep, // keep textures and samplers as is (default) + EShTexSampTransUpgradeTextureRemoveSampler, // change texture w/o embeded sampler into sampled texture and throw away all samplers + LAST_ELEMENT_MARKER(EShTexSampTransCount), +} EShTextureSamplerTransformMode; + +// +// Message choices for what errors and warnings are given. +// +enum EShMessages : unsigned { + EShMsgDefault = 0, // default is to give all required errors and extra warnings + EShMsgRelaxedErrors = (1 << 0), // be liberal in accepting input + EShMsgSuppressWarnings = (1 << 1), // suppress all warnings, except those required by the specification + EShMsgAST = (1 << 2), // print the AST intermediate representation + EShMsgSpvRules = (1 << 3), // issue messages for SPIR-V generation + EShMsgVulkanRules = (1 << 4), // issue messages for Vulkan-requirements of GLSL for SPIR-V + EShMsgOnlyPreprocessor = (1 << 5), // only print out errors produced by the preprocessor + EShMsgReadHlsl = (1 << 6), // use HLSL parsing rules and semantics + EShMsgCascadingErrors = (1 << 7), // get cascading errors; risks error-recovery issues, instead of an early exit + EShMsgKeepUncalled = (1 << 8), // for testing, don't eliminate uncalled functions + EShMsgHlslOffsets = (1 << 9), // allow block offsets to follow HLSL rules instead of GLSL rules + EShMsgDebugInfo = (1 << 10), // save debug information + EShMsgHlslEnable16BitTypes = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL + EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages + EShMsgHlslDX9Compatible = (1 << 13), // enable HLSL DX9 compatible mode (for samplers and semantics) + EShMsgBuiltinSymbolTable = (1 << 14), // print the builtin symbol table + EShMsgEnhanced = (1 << 15), // enhanced message readability + EShMsgAbsolutePath = (1 << 16), // Output Absolute path for messages + EShMsgDisplayErrorColumn = (1 << 17), // Display error message column aswell as line + EShMsgLinkTimeOptimization = (1 << 18), // perform cross-stage optimizations during linking + EShMsgValidateCrossStageIO = (1 << 19), // validate shader inputs have matching outputs in previous stage + LAST_ELEMENT_MARKER(EShMsgCount), +}; + +// +// Options for building reflection +// +typedef enum { + EShReflectionDefault = 0, // default is original behaviour before options were added + EShReflectionStrictArraySuffix = (1 << 0), // reflection will follow stricter rules for array-of-structs suffixes + EShReflectionBasicArraySuffix = (1 << 1), // arrays of basic types will be appended with [0] as in GL reflection + EShReflectionIntermediateIO = (1 << 2), // reflect inputs and outputs to program, even with no vertex shader + EShReflectionSeparateBuffers = (1 << 3), // buffer variables and buffer blocks are reflected separately + EShReflectionAllBlockVariables = (1 << 4), // reflect all variables in blocks, even if they are inactive + EShReflectionUnwrapIOBlocks = (1 << 5), // unwrap input/output blocks the same as with uniform blocks + EShReflectionAllIOVariables = (1 << 6), // reflect all input/output variables, even if they are inactive + EShReflectionSharedStd140SSBO = (1 << 7), // Apply std140/shared rules for ubo to ssbo + EShReflectionSharedStd140UBO = (1 << 8), // Apply std140/shared rules for ubo to ssbo + LAST_ELEMENT_MARKER(EShReflectionCount), +} EShReflectionOptions; + +// +// Build a table for bindings. This can be used for locating +// attributes, uniforms, globals, etc., as needed. +// +typedef struct { + const char* name; + int binding; +} ShBinding; + +typedef struct { + int numBindings; + ShBinding* bindings; // array of bindings +} ShBindingTable; + +// +// ShHandle held by but opaque to the driver. It is allocated, +// managed, and de-allocated by the compiler/linker. Its contents +// are defined by and used by the compiler and linker. For example, +// symbol table information and object code passed from the compiler +// to the linker can be stored where ShHandle points. +// +// If handle creation fails, 0 will be returned. +// +typedef void* ShHandle; + +// +// Driver calls these to create and destroy compiler/linker +// objects. +// +GLSLANG_EXPORT ShHandle ShConstructCompiler(const EShLanguage, int /*debugOptions unused*/); // one per shader +GLSLANG_EXPORT ShHandle ShConstructLinker(const EShExecutable, int /*debugOptions unused*/); // one per shader pair +GLSLANG_EXPORT ShHandle ShConstructUniformMap(); // one per uniform namespace (currently entire program object) +GLSLANG_EXPORT void ShDestruct(ShHandle); + +// +// The return value of ShCompile is boolean, non-zero indicating +// success. +// +// The info-log should be written by ShCompile into +// ShHandle, so it can answer future queries. +// +GLSLANG_EXPORT int ShCompile(const ShHandle, const char* const shaderStrings[], const int numStrings, + const int* lengths, const EShOptimizationLevel, const TBuiltInResource* resources, + int, // debugOptions unused + int defaultVersion = 110, // use 100 for ES environment, overridden by #version in shader + bool forwardCompatible = false, // give errors for use of deprecated features + EShMessages messages = EShMsgDefault, // warnings and errors + const char* fileName = nullptr +); + +GLSLANG_EXPORT int ShLinkExt( + const ShHandle, // linker object + const ShHandle h[], // compiler objects to link together + const int numHandles); + +// +// ShSetEncrpytionMethod is a place-holder for specifying +// how source code is encrypted. +// +GLSLANG_EXPORT void ShSetEncryptionMethod(ShHandle); + +// +// All the following return 0 if the information is not +// available in the object passed down, or the object is bad. +// +GLSLANG_EXPORT const char* ShGetInfoLog(const ShHandle); +GLSLANG_EXPORT const void* ShGetExecutable(const ShHandle); +GLSLANG_EXPORT int ShSetVirtualAttributeBindings(const ShHandle, const ShBindingTable*); // to detect user aliasing +GLSLANG_EXPORT int ShSetFixedAttributeBindings(const ShHandle, const ShBindingTable*); // to force any physical mappings +// +// Tell the linker to never assign a vertex attribute to this list of physical attributes +// +GLSLANG_EXPORT int ShExcludeAttributes(const ShHandle, int *attributes, int count); + +// +// Returns the location ID of the named uniform. +// Returns -1 if error. +// +GLSLANG_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* name); + +#ifdef __cplusplus + } // end extern "C" +#endif + +//////////////////////////////////////////////////////////////////////////////////////////// +// +// Deferred-Lowering C++ Interface +// ----------------------------------- +// +// Below is a new alternate C++ interface, which deprecates the above +// opaque handle-based interface. +// +// The below is further designed to handle multiple compilation units per stage, where +// the intermediate results, including the parse tree, are preserved until link time, +// rather than the above interface which is designed to have each compilation unit +// lowered at compile time. In the above model, linking occurs on the lowered results, +// whereas in this model intra-stage linking can occur at the parse tree +// (treeRoot in TIntermediate) level, and then a full stage can be lowered. +// + +#include +#include +#include + +class TCompiler; +class TInfoSink; + +namespace glslang { + +struct Version { + int major; + int minor; + int patch; + const char* flavor; +}; + +GLSLANG_EXPORT Version GetVersion(); +GLSLANG_EXPORT const char* GetEsslVersionString(); +GLSLANG_EXPORT const char* GetGlslVersionString(); +GLSLANG_EXPORT int GetKhronosToolId(); + +class TIntermediate; +class TProgram; +class TPoolAllocator; +class TIoMapResolver; + +// Call this exactly once per process before using anything else +GLSLANG_EXPORT bool InitializeProcess(); + +// Call once per process to tear down everything +GLSLANG_EXPORT void FinalizeProcess(); + +// Resource type for IO resolver +enum TResourceType { + EResSampler, + EResTexture, + EResImage, + EResUbo, + EResSsbo, + EResUav, + EResCombinedSampler, + EResAs, + EResTensor, + EResCount +}; + +enum TBlockStorageClass +{ + EbsUniform = 0, + EbsStorageBuffer, + EbsPushConstant, + EbsNone, // not a uniform or buffer variable + EbsCount, +}; + +// Make one TShader per shader that you will link into a program. Then +// - provide the shader through setStrings() or setStringsWithLengths() +// - optionally call setEnv*(), see below for more detail +// - optionally use setPreamble() to set a special shader string that will be +// processed before all others but won't affect the validity of #version +// - optionally call addProcesses() for each setting/transform, +// see comment for class TProcesses +// - call parse(): source language and target environment must be selected +// either by correct setting of EShMessages sent to parse(), or by +// explicitly calling setEnv*() +// - query the info logs +// +// N.B.: Does not yet support having the same TShader instance being linked into +// multiple programs. +// +// N.B.: Destruct a linked program *before* destructing the shaders linked into it. +// +class GLSLANG_EXPORT TShader { +public: + explicit TShader(EShLanguage); + virtual ~TShader(); + void setStrings(const char* const* s, int n); + void setStringsWithLengths( + const char* const* s, const int* l, int n); + void setStringsWithLengthsAndNames( + const char* const* s, const int* l, const char* const* names, int n); + void setPreamble(const char* s) { preamble = s; } + void setEntryPoint(const char* entryPoint); + void setSourceEntryPoint(const char* sourceEntryPointName); + void addProcesses(const std::vector&); + void setUniqueId(unsigned long long id); + void setOverrideVersion(int version); + void setDebugInfo(bool debugInfo); + + // IO resolver binding data: see comments in ShaderLang.cpp + void setShiftBinding(TResourceType res, unsigned int base); + void setShiftSamplerBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftTextureBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftImageBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftUboBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftUavBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftCbufferBinding(unsigned int base); // synonym for setShiftUboBinding + void setShiftSsboBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set); + void setResourceSetBinding(const std::vector& base); + void setAutoMapBindings(bool map); + void setAutoMapLocations(bool map); + void addUniformLocationOverride(const char* name, int loc); + void setUniformLocationBase(int base); + void setInvertY(bool invert); + void setDxPositionW(bool dxPosW); + void setEnhancedMsgs(); +#ifdef ENABLE_HLSL + void setHlslIoMapping(bool hlslIoMap); + void setFlattenUniformArrays(bool flatten); +#endif + void setNoStorageFormat(bool useUnknownFormat); + void setNanMinMaxClamp(bool nanMinMaxClamp); + void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode); + void addBlockStorageOverride(const char* nameStr, glslang::TBlockStorageClass backing); + + void setGlobalUniformBlockName(const char* name); + void setAtomicCounterBlockName(const char* name); + void setGlobalUniformSet(unsigned int set); + void setGlobalUniformBinding(unsigned int binding); + void setAtomicCounterBlockSet(unsigned int set); + void setAtomicCounterBlockBinding(unsigned int binding); + + void addSourceText(const char* text, size_t len); + void setSourceFile(const char* file); + + // For setting up the environment (cleared to nothingness in the constructor). + // These must be called so that parsing is done for the right source language and + // target environment, either indirectly through TranslateEnvironment() based on + // EShMessages et. al., or directly by the user. + // + // setEnvInput: The input source language and stage. If generating code for a + // specific client, the input client semantics to use and the + // version of that client's input semantics to use, otherwise + // use EShClientNone and version of 0, e.g. for validation mode. + // Note 'version' does not describe the target environment, + // just the version of the source dialect to compile under. + // For example, to choose the Vulkan dialect of GLSL defined by + // version 100 of the KHR_vulkan_glsl extension: lang = EShSourceGlsl, + // dialect = EShClientVulkan, and version = 100. + // + // See the definitions of TEnvironment, EShSource, EShLanguage, + // and EShClient for choices and more detail. + // + // setEnvClient: The client that will be hosting the execution, and its version. + // Note 'version' is not the version of the languages involved, but + // the version of the client environment. + // Use EShClientNone and version of 0 if there is no client, e.g. + // for validation mode. + // + // See EShTargetClientVersion for choices. + // + // setEnvTarget: The language to translate to when generating code, and that + // language's version. + // Use EShTargetNone and version of 0 if there is no client, e.g. + // for validation mode. + // + void setEnvInput(EShSource lang, EShLanguage envStage, EShClient client, int version) + { + environment.input.languageFamily = lang; + environment.input.stage = envStage; + environment.input.dialect = client; + environment.input.dialectVersion = version; + } + void setEnvClient(EShClient client, EShTargetClientVersion version) + { + environment.client.client = client; + environment.client.version = version; + } + void setEnvTarget(EShTargetLanguage lang, EShTargetLanguageVersion version) + { + environment.target.language = lang; + environment.target.version = version; + } + + void getStrings(const char* const* &s, int& n) { s = strings; n = numStrings; } + +#ifdef ENABLE_HLSL + void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; } + bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; } +#else + bool getEnvTargetHlslFunctionality1() const { return false; } +#endif + + void setEnvInputVulkanRulesRelaxed() { environment.input.vulkanRulesRelaxed = true; } + bool getEnvInputVulkanRulesRelaxed() const { return environment.input.vulkanRulesRelaxed; } + + void setCompileOnly() { compileOnly = true; } + bool getCompileOnly() const { return compileOnly; } + + // Interface to #include handlers. + // + // To support #include, a client of Glslang does the following: + // 1. Call setStringsWithNames to set the source strings and associated + // names. For example, the names could be the names of the files + // containing the shader sources. + // 2. Call parse with an Includer. + // + // When the Glslang parser encounters an #include directive, it calls + // the Includer's include method with the requested include name + // together with the current string name. The returned IncludeResult + // contains the fully resolved name of the included source, together + // with the source text that should replace the #include directive + // in the source stream. After parsing that source, Glslang will + // release the IncludeResult object. + class Includer { + public: + // An IncludeResult contains the resolved name and content of a source + // inclusion. + struct IncludeResult { + IncludeResult(const std::string& headerName, const char* const headerData, const size_t headerLength, void* userData) : + headerName(headerName), headerData(headerData), headerLength(headerLength), userData(userData) { } + // For a successful inclusion, the fully resolved name of the requested + // include. For example, in a file system-based includer, full resolution + // should convert a relative path name into an absolute path name. + // For a failed inclusion, this is an empty string. + const std::string headerName; + // The content and byte length of the requested inclusion. The + // Includer producing this IncludeResult retains ownership of the + // storage. + // For a failed inclusion, the header + // field points to a string containing error details. + const char* const headerData; + const size_t headerLength; + // Include resolver's context. + void* userData; + protected: + IncludeResult& operator=(const IncludeResult&); + IncludeResult(); + }; + + // For both include methods below: + // + // Resolves an inclusion request by name, current source name, + // and include depth. + // On success, returns an IncludeResult containing the resolved name + // and content of the include. + // On failure, returns a nullptr, or an IncludeResult + // with an empty string for the headerName and error details in the + // header field. + // The Includer retains ownership of the contents + // of the returned IncludeResult value, and those contents must + // remain valid until the releaseInclude method is called on that + // IncludeResult object. + // + // Note "local" vs. "system" is not an "either/or": "local" is an + // extra thing to do over "system". Both might get called, as per + // the C++ specification. + + // For the "system" or <>-style includes; search the "system" paths. + virtual IncludeResult* includeSystem(const char* /*headerName*/, + const char* /*includerName*/, + size_t /*inclusionDepth*/) { return nullptr; } + + // For the "local"-only aspect of a "" include. Should not search in the + // "system" paths, because on returning a failure, the parser will + // call includeSystem() to look in the "system" locations. + virtual IncludeResult* includeLocal(const char* /*headerName*/, + const char* /*includerName*/, + size_t /*inclusionDepth*/) { return nullptr; } + + // Signals that the parser will no longer use the contents of the + // specified IncludeResult. + virtual void releaseInclude(IncludeResult*) = 0; + virtual ~Includer() {} + }; + + // Fail all Includer searches + class ForbidIncluder : public Includer { + public: + virtual void releaseInclude(IncludeResult*) override { } + }; + + bool parse( + const TBuiltInResource*, int defaultVersion, EProfile defaultProfile, + bool forceDefaultVersionAndProfile, bool forwardCompatible, + EShMessages, Includer&); + + bool parse(const TBuiltInResource* res, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, + bool forwardCompatible, EShMessages messages) + { + TShader::ForbidIncluder includer; + return parse(res, defaultVersion, defaultProfile, forceDefaultVersionAndProfile, forwardCompatible, messages, includer); + } + + // Equivalent to parse() without a default profile and without forcing defaults. + bool parse(const TBuiltInResource* builtInResources, int defaultVersion, bool forwardCompatible, EShMessages messages) + { + return parse(builtInResources, defaultVersion, ENoProfile, false, forwardCompatible, messages); + } + + bool parse(const TBuiltInResource* builtInResources, int defaultVersion, bool forwardCompatible, EShMessages messages, + Includer& includer) + { + return parse(builtInResources, defaultVersion, ENoProfile, false, forwardCompatible, messages, includer); + } + + // NOTE: Doing just preprocessing to obtain a correct preprocessed shader string + // is not an officially supported or fully working path. + bool preprocess( + const TBuiltInResource* builtInResources, int defaultVersion, + EProfile defaultProfile, bool forceDefaultVersionAndProfile, + bool forwardCompatible, EShMessages message, std::string* outputString, + Includer& includer); + + const char* getInfoLog(); + const char* getInfoDebugLog(); + EShLanguage getStage() const { return stage; } + TIntermediate* getIntermediate() const { return intermediate; } + +protected: + TPoolAllocator* pool; + EShLanguage stage; + TCompiler* compiler; + TIntermediate* intermediate; + TInfoSink* infoSink; + // strings and lengths follow the standard for glShaderSource: + // strings is an array of numStrings pointers to string data. + // lengths can be null, but if not it is an array of numStrings + // integers containing the length of the associated strings. + // if lengths is null or lengths[n] < 0 the associated strings[n] is + // assumed to be null-terminated. + // stringNames is the optional names for all the strings. If stringNames + // is null, then none of the strings has name. If a certain element in + // stringNames is null, then the corresponding string does not have name. + const char* const* strings; // explicit code to compile, see previous comment + const int* lengths; + const char* const* stringNames; + int numStrings; // size of the above arrays + const char* preamble; // string of implicit code to compile before the explicitly provided code + + // a function in the source string can be renamed FROM this TO the name given in setEntryPoint. + std::string sourceEntryPointName; + + // overrides #version in shader source or default version if #version isn't present + int overrideVersion; + + TEnvironment environment; + + // Indicates this shader is meant to be used without linking + bool compileOnly = false; + + friend class TProgram; + +private: + TShader& operator=(TShader&); +}; + +// +// A reflection database and its interface, consistent with the OpenGL API reflection queries. +// + +// Data needed for just a single object at the granularity exchanged by the reflection API +class GLSLANG_EXPORT TObjectReflection { +public: + TObjectReflection(const std::string& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex); + + const TType* getType() const { return type; } + int getBinding() const; + void dump() const; + static TObjectReflection badReflection() { return TObjectReflection(); } + + unsigned int layoutLocation() const; + + std::string name; + int offset; + int glDefineType; + int size; // data size in bytes for a block, array size for a (non-block) object that's an array + int index; + int counterIndex; + int numMembers; + int arrayStride; // stride of an array variable + int topLevelArraySize; // size of the top-level variable in a storage buffer member + int topLevelArrayStride; // stride of the top-level variable in a storage buffer member + EShLanguageMask stages; + +protected: + TObjectReflection() + : offset(-1), glDefineType(-1), size(-1), index(-1), counterIndex(-1), numMembers(-1), arrayStride(0), + topLevelArrayStride(0), stages(EShLanguageMask(0)), type(nullptr) + { + } + + const TType* type; +}; + +class TReflection; +class TIoMapper; +struct TVarEntryInfo; + +// Allows to customize the binding layout after linking. +// All used uniform variables will invoke at least validateBinding. +// If validateBinding returned true then the other resolveBinding, +// resolveSet, and resolveLocation are invoked to resolve the binding +// and descriptor set index respectively. +// +// Invocations happen in a particular order: +// 1) all shader inputs +// 2) all shader outputs +// 3) all uniforms with binding and set already defined +// 4) all uniforms with binding but no set defined +// 5) all uniforms with set but no binding defined +// 6) all uniforms with no binding and no set defined +// +// mapIO will use this resolver in two phases. The first +// phase is a notification phase, calling the corresponging +// notifiy callbacks, this phase ends with a call to endNotifications. +// Phase two starts directly after the call to endNotifications +// and calls all other callbacks to validate and to get the +// bindings, sets, locations, component and color indices. +// +// NOTE: that still limit checks are applied to bindings and sets +// and may result in an error. +class GLSLANG_EXPORT TIoMapResolver { +public: + virtual ~TIoMapResolver() {} + + // Should return true if the resulting/current binding would be okay. + // Basic idea is to do aliasing binding checks with this. + virtual bool validateBinding(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current binding should be overridden. + // Return -1 if the current binding (including no binding) should be kept. + virtual int resolveBinding(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current set should be overridden. + // Return -1 if the current set (including no set) should be kept. + virtual int resolveSet(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current location should be overridden. + // Return -1 if the current location (including no location) should be kept. + virtual int resolveUniformLocation(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return true if the resulting/current setup would be okay. + // Basic idea is to do aliasing checks and reject invalid semantic names. + virtual bool validateInOut(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current location should be overridden. + // Return -1 if the current location (including no location) should be kept. + virtual int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current component index should be overridden. + // Return -1 if the current component index (including no index) should be kept. + virtual int resolveInOutComponent(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current color index should be overridden. + // Return -1 if the current color index (including no index) should be kept. + virtual int resolveInOutIndex(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Notification of a uniform variable + virtual void notifyBinding(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Notification of a in or out variable + virtual void notifyInOut(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Called by mapIO when it starts its notify pass for the given stage + virtual void beginNotifications(EShLanguage stage) = 0; + // Called by mapIO when it has finished the notify pass + virtual void endNotifications(EShLanguage stage) = 0; + // Called by mipIO when it starts its resolve pass for the given stage + virtual void beginResolve(EShLanguage stage) = 0; + // Called by mapIO when it has finished the resolve pass + virtual void endResolve(EShLanguage stage) = 0; + // Called by mapIO when it starts its symbol collect for teh given stage + virtual void beginCollect(EShLanguage stage) = 0; + // Called by mapIO when it has finished the symbol collect + virtual void endCollect(EShLanguage stage) = 0; + // Called by TSlotCollector to resolve storage locations or bindings + virtual void reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) = 0; + // Called by TSlotCollector to resolve resource locations or bindings + virtual void reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) = 0; + // Called by mapIO.addStage to set shader stage mask to mark a stage be added to this pipeline + virtual void addStage(EShLanguage stage, TIntermediate& stageIntermediate) = 0; +}; + +// I/O mapper +class TIoMapper { +public: + TIoMapper() {} + virtual ~TIoMapper() {} + // grow the reflection stage by stage + bool virtual addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*); + bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; } + bool virtual setAutoPushConstantBlock(const char*, unsigned int, TLayoutPacking) { return false; } +}; + +// Get the default GLSL IO mapper +GLSLANG_EXPORT TIoMapper* GetGlslIoMapper(); + +// Make one TProgram per set of shaders that will get linked together. Add all +// the shaders that are to be linked together. After calling shader.parse() +// for all shaders, call link(). +// +// N.B.: Destruct a linked program *before* destructing the shaders linked into it. +// +class GLSLANG_EXPORT TProgram { +public: + TProgram(); + virtual ~TProgram(); + void addShader(TShader* shader) { stages[shader->stage].push_back(shader); } + std::list& getShaders(EShLanguage stage) { return stages[stage]; } + // Link Validation interface + bool link(EShMessages); + const char* getInfoLog(); + const char* getInfoDebugLog(); + + TIntermediate* getIntermediate(EShLanguage stage) const { return intermediate[stage]; } + + // Reflection Interface + + // call first, to do liveness analysis, index mapping, etc.; returns false on failure + bool buildReflection(int opts = EShReflectionDefault); + unsigned getLocalSize(int dim) const; // return dim'th local size + unsigned getTileShadingRateQCOM(int dim) const; // return dim'th tile shading rate QCOM + int getReflectionIndex(const char *name) const; + int getReflectionPipeIOIndex(const char* name, const bool inOrOut) const; + int getNumUniformVariables() const; + const TObjectReflection& getUniform(int index) const; + int getNumUniformBlocks() const; + const TObjectReflection& getUniformBlock(int index) const; + int getNumPipeInputs() const; + const TObjectReflection& getPipeInput(int index) const; + int getNumPipeOutputs() const; + const TObjectReflection& getPipeOutput(int index) const; + int getNumBufferVariables() const; + const TObjectReflection& getBufferVariable(int index) const; + int getNumBufferBlocks() const; + const TObjectReflection& getBufferBlock(int index) const; + int getNumAtomicCounters() const; + const TObjectReflection& getAtomicCounter(int index) const; + + // Legacy Reflection Interface - expressed in terms of above interface + + // can be used for glGetProgramiv(GL_ACTIVE_UNIFORMS) + int getNumLiveUniformVariables() const { return getNumUniformVariables(); } + + // can be used for glGetProgramiv(GL_ACTIVE_UNIFORM_BLOCKS) + int getNumLiveUniformBlocks() const { return getNumUniformBlocks(); } + + // can be used for glGetProgramiv(GL_ACTIVE_ATTRIBUTES) + int getNumLiveAttributes() const { return getNumPipeInputs(); } + + // can be used for glGetUniformIndices() + int getUniformIndex(const char *name) const { return getReflectionIndex(name); } + + int getPipeIOIndex(const char *name, const bool inOrOut) const + { return getReflectionPipeIOIndex(name, inOrOut); } + + // can be used for "name" part of glGetActiveUniform() + const char *getUniformName(int index) const { return getUniform(index).name.c_str(); } + + // returns the binding number + int getUniformBinding(int index) const { return getUniform(index).getBinding(); } + + // returns Shaders Stages where a Uniform is present + EShLanguageMask getUniformStages(int index) const { return getUniform(index).stages; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX) + int getUniformBlockIndex(int index) const { return getUniform(index).index; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE) + int getUniformType(int index) const { return getUniform(index).glDefineType; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_OFFSET) + int getUniformBufferOffset(int index) const { return getUniform(index).offset; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_SIZE) + int getUniformArraySize(int index) const { return getUniform(index).size; } + + // returns a TType* + const TType *getUniformTType(int index) const { return getUniform(index).getType(); } + + // can be used for glGetActiveUniformBlockName() + const char *getUniformBlockName(int index) const { return getUniformBlock(index).name.c_str(); } + + // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE) + int getUniformBlockSize(int index) const { return getUniformBlock(index).size; } + + // returns the block binding number + int getUniformBlockBinding(int index) const { return getUniformBlock(index).getBinding(); } + + // returns block index of associated counter. + int getUniformBlockCounterIndex(int index) const { return getUniformBlock(index).counterIndex; } + + // returns a TType* + const TType *getUniformBlockTType(int index) const { return getUniformBlock(index).getType(); } + + // can be used for glGetActiveAttrib() + const char *getAttributeName(int index) const { return getPipeInput(index).name.c_str(); } + + // can be used for glGetActiveAttrib() + int getAttributeType(int index) const { return getPipeInput(index).glDefineType; } + + // returns a TType* + const TType *getAttributeTType(int index) const { return getPipeInput(index).getType(); } + + void dumpReflection(); + + // Get the IO resolver to use for mapIO + TIoMapResolver* getGlslIoResolver(EShLanguage stage); + + // I/O mapping: apply base offsets and map live unbound variables + // If resolver is not provided it uses the previous approach + // and respects auto assignment and offsets. + bool mapIO(TIoMapResolver* pResolver = nullptr, TIoMapper* pIoMapper = nullptr); + +protected: + bool linkStage(EShLanguage, EShMessages); + bool crossStageCheck(EShMessages); + + TPoolAllocator* pool; + std::list stages[EShLangCount]; + TIntermediate* intermediate[EShLangCount]; + bool newedIntermediate[EShLangCount]; // track which intermediate were "new" versus reusing a singleton unit in a stage + TInfoSink* infoSink; + TReflection* reflection; + bool linked; + +private: + TProgram(TProgram&); + TProgram& operator=(TProgram&); +}; + +} // end namespace glslang + +#endif // _COMPILER_INTERFACE_INCLUDED_ diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/Public/resource_limits_c.h b/app/libs/ncnn/arm64-v8a/include/glslang/Public/resource_limits_c.h new file mode 100644 index 0000000..4ad052b --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/Public/resource_limits_c.h @@ -0,0 +1,58 @@ +/** +BSD 2-Clause License + +Copyright (c) 2020, Travis Fort +All rights reserved. + +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. +**/ + +#ifndef _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ +#define _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ + +#include "../Include/glslang_c_interface.h" +#include "../Include/visibility.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Returns a struct that can be use to create custom resource values. +GLSLANG_EXPORT glslang_resource_t* glslang_resource(void); + +// These are the default resources for TBuiltInResources, used for both +// - parsing this string for the case where the user didn't supply one, +// - dumping out a template for user construction of a config file. +GLSLANG_EXPORT const glslang_resource_t* glslang_default_resource(void); + +// Returns the DefaultTBuiltInResource as a human-readable string. +// NOTE: User is responsible for freeing this string. +GLSLANG_EXPORT const char* glslang_default_resource_string(void); + +// Decodes the resource limits from |config| to |resources|. +GLSLANG_EXPORT void glslang_decode_resource_limits(glslang_resource_t* resources, char* config); + +#ifdef __cplusplus +} +#endif + +#endif // _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/GlslangToSpv.h b/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/GlslangToSpv.h new file mode 100644 index 0000000..9fb4f3f --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/GlslangToSpv.h @@ -0,0 +1,69 @@ +// +// Copyright (C) 2014 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. + +#pragma once + +#include +#include + +#include "Logger.h" +#include "glslang/Include/visibility.h" + +namespace glslang { +class TIntermediate; + +struct SpvOptions { + bool generateDebugInfo {false}; + bool stripDebugInfo {false}; + bool disableOptimizer {true}; + bool optimizeSize {false}; + bool disassemble {false}; + bool validate {false}; + bool emitNonSemanticShaderDebugInfo {false}; + bool emitNonSemanticShaderDebugSource{ false }; + bool compileOnly{false}; + bool optimizerAllowExpandedIDBound{false}; +}; + +GLSLANG_EXPORT void GetSpirvVersion(std::string&); +GLSLANG_EXPORT int GetSpirvGeneratorVersion(); +GLSLANG_EXPORT void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, + SpvOptions* options = nullptr); +GLSLANG_EXPORT void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger* logger, SpvOptions* options = nullptr); +GLSLANG_EXPORT bool OutputSpvBin(const std::vector& spirv, const char* baseName); +GLSLANG_EXPORT bool OutputSpvHex(const std::vector& spirv, const char* baseName, const char* varName); + +} diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/Logger.h b/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/Logger.h new file mode 100644 index 0000000..c64a3b8 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/Logger.h @@ -0,0 +1,75 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of Google Inc. 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 HOLDERS 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. + +#ifndef GLSLANG_SPIRV_LOGGER_H +#define GLSLANG_SPIRV_LOGGER_H + +#include +#include +#include "glslang/Include/visibility.h" + +namespace spv { + +// A class for holding all SPIR-V build status messages, including +// missing/TBD functionalities, warnings, and errors. +class GLSLANG_EXPORT SpvBuildLogger { +public: + SpvBuildLogger() {} + + // Registers a TBD functionality. + void tbdFunctionality(const std::string& f); + // Registers a missing functionality. + void missingFunctionality(const std::string& f); + + // Logs a warning. + void warning(const std::string& w) { warnings.push_back(w); } + // Logs an error. + void error(const std::string& e) { errors.push_back(e); } + + // Returns all messages accumulated in the order of: + // TBD functionalities, missing functionalities, warnings, errors. + std::string getAllMessages() const; + +private: + SpvBuildLogger(const SpvBuildLogger&); + + std::vector tbdFeatures; + std::vector missingFeatures; + std::vector warnings; + std::vector errors; +}; + +} // end spv namespace + +#endif // GLSLANG_SPIRV_LOGGER_H diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/SpvTools.h b/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/SpvTools.h new file mode 100644 index 0000000..4558572 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/SpvTools.h @@ -0,0 +1,109 @@ +// +// Copyright (C) 2014-2016 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. + +// +// Call into SPIRV-Tools to disassemble, validate, and optimize. +// + +#pragma once +#ifndef GLSLANG_SPV_TOOLS_H +#define GLSLANG_SPV_TOOLS_H + +#if ENABLE_OPT +#include +#include +#include +#include "spirv-tools/libspirv.h" +#endif + +#include "glslang/MachineIndependent/Versions.h" +#include "glslang/Include/visibility.h" +#include "GlslangToSpv.h" +#include "Logger.h" + +namespace glslang { + +#if ENABLE_OPT + +class TIntermediate; + +// Translate glslang's view of target versioning to what SPIRV-Tools uses. +GLSLANG_EXPORT spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger); +GLSLANG_EXPORT spv_target_env MapToSpirvToolsEnv(const glslang::TIntermediate& intermediate, spv::SpvBuildLogger* logger); + +// Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment. +GLSLANG_EXPORT void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv); + +// Use the SPIRV-Tools disassembler to print SPIR-V with a provided SPIR-V environment. +GLSLANG_EXPORT void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv, + spv_target_env requested_context); + +// Apply the SPIRV-Tools validator to generated SPIR-V. +GLSLANG_EXPORT void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger*, bool prelegalization); + +// Apply the SPIRV-Tools optimizer to generated SPIR-V. HLSL SPIR-V is legalized in the process. +GLSLANG_EXPORT void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger*, const SpvOptions*); + +// Apply the SPIRV-Tools EliminateDeadInputComponents pass to generated SPIR-V. Put result in |spirv|. +GLSLANG_EXPORT void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector& spirv, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools AnalyzeDeadOutputStores pass to generated SPIR-V. Put result in |live_locs|. +// Return true if the result is valid. +GLSLANG_EXPORT bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools EliminateDeadOutputStores and AggressiveDeadCodeElimination passes to generated SPIR-V using +// |live_locs|. Put result in |spirv|. +GLSLANG_EXPORT void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by +// SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if +// optimization is disabled. +GLSLANG_EXPORT void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate, + std::vector& spirv, spv::SpvBuildLogger*); + +#endif + +} // end namespace glslang + +#endif // GLSLANG_SPV_TOOLS_H diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/disassemble.h b/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/disassemble.h new file mode 100644 index 0000000..3bded14 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/disassemble.h @@ -0,0 +1,55 @@ +// +// Copyright (C) 2014-2015 LunarG, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. + +// +// Disassembler for SPIR-V. +// + +#pragma once +#ifndef disassembler_H +#define disassembler_H + +#include +#include + +#include "glslang/Include/visibility.h" + +namespace spv { + + // disassemble with glslang custom disassembler + GLSLANG_EXPORT void Disassemble(std::ostream& out, const std::vector&); + +} // end namespace spv + +#endif // disassembler_H diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/spirv.hpp11 b/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/spirv.hpp11 new file mode 100644 index 0000000..7708834 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/SPIRV/spirv.hpp11 @@ -0,0 +1,5351 @@ +// Copyright (c) 2014-2024 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. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python, C#, D, Beef +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// - C# will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL +// - Beef will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10600 +#define SPV_REVISION 1 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010600; +static const unsigned int Revision = 1; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + CPP_for_OpenCL = 6, + SYCL = 7, + HERO_C = 8, + NZSL = 9, + WGSL = 10, + Slang = 11, + Zig = 12, + Rust = 13, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + TaskNV = 5267, + MeshNV = 5268, + RayGenerationKHR = 5313, + RayGenerationNV = 5313, + IntersectionKHR = 5314, + IntersectionNV = 5314, + AnyHitKHR = 5315, + AnyHitNV = 5315, + ClosestHitKHR = 5316, + ClosestHitNV = 5316, + MissKHR = 5317, + MissNV = 5317, + CallableKHR = 5318, + CallableNV = 5318, + TaskEXT = 5364, + MeshEXT = 5365, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + PhysicalStorageBuffer64 = 5348, + PhysicalStorageBuffer64EXT = 5348, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Vulkan = 3, + VulkanKHR = 3, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + SubgroupsPerWorkgroupId = 37, + LocalSizeId = 38, + LocalSizeHintId = 39, + NonCoherentColorAttachmentReadEXT = 4169, + NonCoherentDepthAttachmentReadEXT = 4170, + NonCoherentStencilAttachmentReadEXT = 4171, + SubgroupUniformControlFlowKHR = 4421, + PostDepthCoverage = 4446, + DenormPreserve = 4459, + DenormFlushToZero = 4460, + SignedZeroInfNanPreserve = 4461, + RoundingModeRTE = 4462, + RoundingModeRTZ = 4463, + NonCoherentTileAttachmentReadQCOM = 4489, + TileShadingRateQCOM = 4490, + EarlyAndLateFragmentTestsAMD = 5017, + StencilRefReplacingEXT = 5027, + CoalescingAMDX = 5069, + IsApiEntryAMDX = 5070, + MaxNodeRecursionAMDX = 5071, + StaticNumWorkgroupsAMDX = 5072, + ShaderIndexAMDX = 5073, + MaxNumWorkgroupsAMDX = 5077, + StencilRefUnchangedFrontAMD = 5079, + StencilRefGreaterFrontAMD = 5080, + StencilRefLessFrontAMD = 5081, + StencilRefUnchangedBackAMD = 5082, + StencilRefGreaterBackAMD = 5083, + StencilRefLessBackAMD = 5084, + QuadDerivativesKHR = 5088, + RequireFullQuadsKHR = 5089, + SharesInputWithAMDX = 5102, + OutputLinesEXT = 5269, + OutputLinesNV = 5269, + OutputPrimitivesEXT = 5270, + OutputPrimitivesNV = 5270, + DerivativeGroupQuadsKHR = 5289, + DerivativeGroupQuadsNV = 5289, + DerivativeGroupLinearKHR = 5290, + DerivativeGroupLinearNV = 5290, + OutputTrianglesEXT = 5298, + OutputTrianglesNV = 5298, + PixelInterlockOrderedEXT = 5366, + PixelInterlockUnorderedEXT = 5367, + SampleInterlockOrderedEXT = 5368, + SampleInterlockUnorderedEXT = 5369, + ShadingRateInterlockOrderedEXT = 5370, + ShadingRateInterlockUnorderedEXT = 5371, + Shader64BitIndexingEXT = 5427, + SharedLocalMemorySizeINTEL = 5618, + RoundingModeRTPINTEL = 5620, + RoundingModeRTNINTEL = 5621, + FloatingPointModeALTINTEL = 5622, + FloatingPointModeIEEEINTEL = 5623, + MaxWorkgroupSizeINTEL = 5893, + MaxWorkDimINTEL = 5894, + NoGlobalOffsetINTEL = 5895, + NumSIMDWorkitemsINTEL = 5896, + SchedulerTargetFmaxMhzINTEL = 5903, + MaximallyReconvergesKHR = 6023, + FPFastMathDefault = 6028, + StreamingInterfaceINTEL = 6154, + RegisterMapInterfaceINTEL = 6160, + NamedBarrierCountINTEL = 6417, + MaximumRegistersINTEL = 6461, + MaximumRegistersIdINTEL = 6462, + NamedMaximumRegistersINTEL = 6463, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + TileImageEXT = 4172, + TileAttachmentQCOM = 4491, + NodePayloadAMDX = 5068, + CallableDataKHR = 5328, + CallableDataNV = 5328, + IncomingCallableDataKHR = 5329, + IncomingCallableDataNV = 5329, + RayPayloadKHR = 5338, + RayPayloadNV = 5338, + HitAttributeKHR = 5339, + HitAttributeNV = 5339, + IncomingRayPayloadKHR = 5342, + IncomingRayPayloadNV = 5342, + ShaderRecordBufferKHR = 5343, + ShaderRecordBufferNV = 5343, + PhysicalStorageBuffer = 5349, + PhysicalStorageBufferEXT = 5349, + HitObjectAttributeNV = 5385, + TaskPayloadWorkgroupEXT = 5402, + HitObjectAttributeEXT = 5411, + CodeSectionINTEL = 5605, + DeviceOnlyINTEL = 5936, + HostOnlyINTEL = 5937, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + TileImageDataEXT = 4173, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + R64ui = 40, + R64i = 41, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + UnsignedIntRaw10EXT = 19, + UnsignedIntRaw12EXT = 20, + UnormInt2_101010EXT = 21, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + MakeTexelAvailable = 8, + MakeTexelAvailableKHR = 8, + MakeTexelVisible = 9, + MakeTexelVisibleKHR = 9, + NonPrivateTexel = 10, + NonPrivateTexelKHR = 10, + VolatileTexel = 11, + VolatileTexelKHR = 11, + SignExtend = 12, + ZeroExtend = 13, + Nontemporal = 14, + Offsets = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, + MakeTexelAvailable = 0x00000100, + MakeTexelAvailableKHR = 0x00000100, + MakeTexelVisible = 0x00000200, + MakeTexelVisibleKHR = 0x00000200, + NonPrivateTexel = 0x00000400, + NonPrivateTexelKHR = 0x00000400, + VolatileTexel = 0x00000800, + VolatileTexelKHR = 0x00000800, + SignExtend = 0x00001000, + ZeroExtend = 0x00002000, + Nontemporal = 0x00004000, + Offsets = 0x00010000, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + AllowContract = 16, + AllowContractFastINTEL = 16, + AllowReassoc = 17, + AllowReassocINTEL = 17, + AllowTransform = 18, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, + AllowContract = 0x00010000, + AllowContractFastINTEL = 0x00010000, + AllowReassoc = 0x00020000, + AllowReassocINTEL = 0x00020000, + AllowTransform = 0x00040000, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + LinkOnceODR = 2, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + RuntimeAlignedINTEL = 5940, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + UniformId = 27, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + AlignmentId = 46, + MaxByteOffsetId = 47, + SaturatedToLargestFloat8NormalConversionEXT = 4216, + NoSignedWrap = 4469, + NoUnsignedWrap = 4470, + WeightTextureQCOM = 4487, + BlockMatchTextureQCOM = 4488, + BlockMatchSamplerQCOM = 4499, + ExplicitInterpAMD = 4999, + NodeSharesPayloadLimitsWithAMDX = 5019, + NodeMaxPayloadsAMDX = 5020, + TrackFinishWritingAMDX = 5078, + PayloadNodeNameAMDX = 5091, + PayloadNodeBaseIndexAMDX = 5098, + PayloadNodeSparseArrayAMDX = 5099, + PayloadNodeArraySizeAMDX = 5100, + PayloadDispatchIndirectAMDX = 5105, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + PerPrimitiveEXT = 5271, + PerPrimitiveNV = 5271, + PerViewNV = 5272, + PerTaskNV = 5273, + PerVertexKHR = 5285, + PerVertexNV = 5285, + NonUniform = 5300, + NonUniformEXT = 5300, + RestrictPointer = 5355, + RestrictPointerEXT = 5355, + AliasedPointer = 5356, + AliasedPointerEXT = 5356, + HitObjectShaderRecordBufferNV = 5386, + HitObjectShaderRecordBufferEXT = 5389, + BindlessSamplerNV = 5398, + BindlessImageNV = 5399, + BoundSamplerNV = 5400, + BoundImageNV = 5401, + SIMTCallINTEL = 5599, + ReferencedIndirectlyINTEL = 5602, + ClobberINTEL = 5607, + SideEffectsINTEL = 5608, + VectorComputeVariableINTEL = 5624, + FuncParamIOKindINTEL = 5625, + VectorComputeFunctionINTEL = 5626, + StackCallINTEL = 5627, + GlobalVariableOffsetINTEL = 5628, + CounterBuffer = 5634, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + UserSemantic = 5635, + UserTypeGOOGLE = 5636, + FunctionRoundingModeINTEL = 5822, + FunctionDenormModeINTEL = 5823, + RegisterINTEL = 5825, + MemoryINTEL = 5826, + NumbanksINTEL = 5827, + BankwidthINTEL = 5828, + MaxPrivateCopiesINTEL = 5829, + SinglepumpINTEL = 5830, + DoublepumpINTEL = 5831, + MaxReplicatesINTEL = 5832, + SimpleDualPortINTEL = 5833, + MergeINTEL = 5834, + BankBitsINTEL = 5835, + ForcePow2DepthINTEL = 5836, + StridesizeINTEL = 5883, + WordsizeINTEL = 5884, + TrueDualPortINTEL = 5885, + BurstCoalesceINTEL = 5899, + CacheSizeINTEL = 5900, + DontStaticallyCoalesceINTEL = 5901, + PrefetchINTEL = 5902, + StallEnableINTEL = 5905, + FuseLoopsInFunctionINTEL = 5907, + MathOpDSPModeINTEL = 5909, + AliasScopeINTEL = 5914, + NoAliasINTEL = 5915, + InitiationIntervalINTEL = 5917, + MaxConcurrencyINTEL = 5918, + PipelineEnableINTEL = 5919, + BufferLocationINTEL = 5921, + IOPipeStorageINTEL = 5944, + FunctionFloatingPointModeINTEL = 6080, + SingleElementVectorINTEL = 6085, + VectorComputeCallableFunctionINTEL = 6087, + MediaBlockIOINTEL = 6140, + StallFreeINTEL = 6151, + FPMaxErrorDecorationINTEL = 6170, + LatencyControlLabelINTEL = 6172, + LatencyControlConstraintINTEL = 6173, + ConduitKernelArgumentINTEL = 6175, + RegisterMapKernelArgumentINTEL = 6176, + MMHostInterfaceAddressWidthINTEL = 6177, + MMHostInterfaceDataWidthINTEL = 6178, + MMHostInterfaceLatencyINTEL = 6179, + MMHostInterfaceReadWriteModeINTEL = 6180, + MMHostInterfaceMaxBurstINTEL = 6181, + MMHostInterfaceWaitRequestINTEL = 6182, + StableKernelArgumentINTEL = 6183, + HostAccessINTEL = 6188, + InitModeINTEL = 6190, + ImplementInRegisterMapINTEL = 6191, + CacheControlLoadINTEL = 6442, + CacheControlStoreINTEL = 6443, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + CoreIDARM = 4160, + CoreCountARM = 4161, + CoreMaxIDARM = 4162, + WarpIDARM = 4163, + WarpMaxIDARM = 4164, + SubgroupEqMask = 4416, + SubgroupEqMaskKHR = 4416, + SubgroupGeMask = 4417, + SubgroupGeMaskKHR = 4417, + SubgroupGtMask = 4418, + SubgroupGtMaskKHR = 4418, + SubgroupLeMask = 4419, + SubgroupLeMaskKHR = 4419, + SubgroupLtMask = 4420, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + PrimitiveShadingRateKHR = 4432, + DeviceIndex = 4438, + ViewIndex = 4440, + ShadingRateKHR = 4444, + TileOffsetQCOM = 4492, + TileDimensionQCOM = 4493, + TileApronSizeQCOM = 4494, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + RemainingRecursionLevelsAMDX = 5021, + ShaderIndexAMDX = 5073, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + FullyCoveredEXT = 5264, + TaskCountNV = 5274, + PrimitiveCountNV = 5275, + PrimitiveIndicesNV = 5276, + ClipDistancePerViewNV = 5277, + CullDistancePerViewNV = 5278, + LayerPerViewNV = 5279, + MeshViewCountNV = 5280, + MeshViewIndicesNV = 5281, + BaryCoordKHR = 5286, + BaryCoordNV = 5286, + BaryCoordNoPerspKHR = 5287, + BaryCoordNoPerspNV = 5287, + FragSizeEXT = 5292, + FragmentSizeNV = 5292, + FragInvocationCountEXT = 5293, + InvocationsPerPixelNV = 5293, + PrimitivePointIndicesEXT = 5294, + PrimitiveLineIndicesEXT = 5295, + PrimitiveTriangleIndicesEXT = 5296, + CullPrimitiveEXT = 5299, + LaunchIdKHR = 5319, + LaunchIdNV = 5319, + LaunchSizeKHR = 5320, + LaunchSizeNV = 5320, + WorldRayOriginKHR = 5321, + WorldRayOriginNV = 5321, + WorldRayDirectionKHR = 5322, + WorldRayDirectionNV = 5322, + ObjectRayOriginKHR = 5323, + ObjectRayOriginNV = 5323, + ObjectRayDirectionKHR = 5324, + ObjectRayDirectionNV = 5324, + RayTminKHR = 5325, + RayTminNV = 5325, + RayTmaxKHR = 5326, + RayTmaxNV = 5326, + InstanceCustomIndexKHR = 5327, + InstanceCustomIndexNV = 5327, + ObjectToWorldKHR = 5330, + ObjectToWorldNV = 5330, + WorldToObjectKHR = 5331, + WorldToObjectNV = 5331, + HitTNV = 5332, + HitKindKHR = 5333, + HitKindNV = 5333, + CurrentRayTimeNV = 5334, + HitTriangleVertexPositionsKHR = 5335, + HitMicroTriangleVertexPositionsNV = 5337, + HitMicroTriangleVertexBarycentricsNV = 5344, + IncomingRayFlagsKHR = 5351, + IncomingRayFlagsNV = 5351, + RayGeometryIndexKHR = 5352, + HitIsSphereNV = 5359, + HitIsLSSNV = 5360, + HitSpherePositionNV = 5361, + WarpsPerSMNV = 5374, + SMCountNV = 5375, + WarpIDNV = 5376, + SMIDNV = 5377, + HitLSSPositionsNV = 5396, + HitKindFrontFacingMicroTriangleNV = 5405, + HitKindBackFacingMicroTriangleNV = 5406, + HitSphereRadiusNV = 5420, + HitLSSRadiiNV = 5421, + ClusterIDNV = 5436, + CullMaskKHR = 6021, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + MinIterations = 4, + MaxIterations = 5, + IterationMultiple = 6, + PeelCount = 7, + PartialCount = 8, + InitiationIntervalINTEL = 16, + MaxConcurrencyINTEL = 17, + DependencyArrayINTEL = 18, + PipelineEnableINTEL = 19, + LoopCoalesceINTEL = 20, + MaxInterleavingINTEL = 21, + SpeculatedIterationsINTEL = 22, + NoFusionINTEL = 23, + LoopCountINTEL = 24, + MaxReinvocationDelayINTEL = 25, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, + MinIterations = 0x00000010, + MaxIterations = 0x00000020, + IterationMultiple = 0x00000040, + PeelCount = 0x00000080, + PartialCount = 0x00000100, + InitiationIntervalINTEL = 0x00010000, + MaxConcurrencyINTEL = 0x00020000, + DependencyArrayINTEL = 0x00040000, + PipelineEnableINTEL = 0x00080000, + LoopCoalesceINTEL = 0x00100000, + MaxInterleavingINTEL = 0x00200000, + SpeculatedIterationsINTEL = 0x00400000, + NoFusionINTEL = 0x00800000, + LoopCountINTEL = 0x01000000, + MaxReinvocationDelayINTEL = 0x02000000, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + OptNoneEXT = 16, + OptNoneINTEL = 16, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, + OptNoneEXT = 0x00010000, + OptNoneINTEL = 0x00010000, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + OutputMemory = 12, + OutputMemoryKHR = 12, + MakeAvailable = 13, + MakeAvailableKHR = 13, + MakeVisible = 14, + MakeVisibleKHR = 14, + Volatile = 15, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, + OutputMemory = 0x00001000, + OutputMemoryKHR = 0x00001000, + MakeAvailable = 0x00002000, + MakeAvailableKHR = 0x00002000, + MakeVisible = 0x00004000, + MakeVisibleKHR = 0x00004000, + Volatile = 0x00008000, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + MakePointerAvailable = 3, + MakePointerAvailableKHR = 3, + MakePointerVisible = 4, + MakePointerVisibleKHR = 4, + NonPrivatePointer = 5, + NonPrivatePointerKHR = 5, + AliasScopeINTELMask = 16, + NoAliasINTELMask = 17, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, + MakePointerAvailable = 0x00000008, + MakePointerAvailableKHR = 0x00000008, + MakePointerVisible = 0x00000010, + MakePointerVisibleKHR = 0x00000010, + NonPrivatePointer = 0x00000020, + NonPrivatePointerKHR = 0x00000020, + AliasScopeINTELMask = 0x00010000, + NoAliasINTELMask = 0x00020000, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + QueueFamily = 5, + QueueFamilyKHR = 5, + ShaderCallKHR = 6, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + ClusteredReduce = 3, + PartitionedReduceNV = 6, + PartitionedInclusiveScanNV = 7, + PartitionedExclusiveScanNV = 8, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + GroupNonUniform = 61, + GroupNonUniformVote = 62, + GroupNonUniformArithmetic = 63, + GroupNonUniformBallot = 64, + GroupNonUniformShuffle = 65, + GroupNonUniformShuffleRelative = 66, + GroupNonUniformClustered = 67, + GroupNonUniformQuad = 68, + ShaderLayer = 69, + ShaderViewportIndex = 70, + UniformDecoration = 71, + CoreBuiltinsARM = 4165, + TileImageColorReadAccessEXT = 4166, + TileImageDepthReadAccessEXT = 4167, + TileImageStencilReadAccessEXT = 4168, + TensorsARM = 4174, + CooperativeMatrixLayoutsARM = 4201, + Float8EXT = 4212, + Float8CooperativeMatrixEXT = 4213, + FragmentShadingRateKHR = 4422, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + WorkgroupMemoryExplicitLayoutKHR = 4428, + WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, + WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + StorageBuffer8BitAccess = 4448, + UniformAndStorageBuffer8BitAccess = 4449, + StoragePushConstant8 = 4450, + DenormPreserve = 4464, + DenormFlushToZero = 4465, + SignedZeroInfNanPreserve = 4466, + RoundingModeRTE = 4467, + RoundingModeRTZ = 4468, + RayQueryProvisionalKHR = 4471, + RayQueryKHR = 4472, + UntypedPointersKHR = 4473, + RayTraversalPrimitiveCullingKHR = 4478, + RayTracingKHR = 4479, + TextureSampleWeightedQCOM = 4484, + TextureBoxFilterQCOM = 4485, + TextureBlockMatchQCOM = 4486, + TileShadingQCOM = 4495, + CooperativeMatrixConversionQCOM = 4496, + TextureBlockMatch2QCOM = 4498, + Float16ImageAMD = 5008, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + Int64ImageEXT = 5016, + ShaderClockKHR = 5055, + ShaderEnqueueAMDX = 5067, + QuadControlKHR = 5087, + BFloat16TypeKHR = 5116, + BFloat16DotProductKHR = 5117, + BFloat16CooperativeMatrixKHR = 5118, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + FragmentFullyCoveredEXT = 5265, + MeshShadingNV = 5266, + ImageFootprintNV = 5282, + MeshShadingEXT = 5283, + FragmentBarycentricKHR = 5284, + FragmentBarycentricNV = 5284, + ComputeDerivativeGroupQuadsKHR = 5288, + ComputeDerivativeGroupQuadsNV = 5288, + FragmentDensityEXT = 5291, + ShadingRateNV = 5291, + GroupNonUniformPartitionedNV = 5297, + ShaderNonUniform = 5301, + ShaderNonUniformEXT = 5301, + RuntimeDescriptorArray = 5302, + RuntimeDescriptorArrayEXT = 5302, + InputAttachmentArrayDynamicIndexing = 5303, + InputAttachmentArrayDynamicIndexingEXT = 5303, + UniformTexelBufferArrayDynamicIndexing = 5304, + UniformTexelBufferArrayDynamicIndexingEXT = 5304, + StorageTexelBufferArrayDynamicIndexing = 5305, + StorageTexelBufferArrayDynamicIndexingEXT = 5305, + UniformBufferArrayNonUniformIndexing = 5306, + UniformBufferArrayNonUniformIndexingEXT = 5306, + SampledImageArrayNonUniformIndexing = 5307, + SampledImageArrayNonUniformIndexingEXT = 5307, + StorageBufferArrayNonUniformIndexing = 5308, + StorageBufferArrayNonUniformIndexingEXT = 5308, + StorageImageArrayNonUniformIndexing = 5309, + StorageImageArrayNonUniformIndexingEXT = 5309, + InputAttachmentArrayNonUniformIndexing = 5310, + InputAttachmentArrayNonUniformIndexingEXT = 5310, + UniformTexelBufferArrayNonUniformIndexing = 5311, + UniformTexelBufferArrayNonUniformIndexingEXT = 5311, + StorageTexelBufferArrayNonUniformIndexing = 5312, + StorageTexelBufferArrayNonUniformIndexingEXT = 5312, + RayTracingPositionFetchKHR = 5336, + RayTracingNV = 5340, + RayTracingMotionBlurNV = 5341, + VulkanMemoryModel = 5345, + VulkanMemoryModelKHR = 5345, + VulkanMemoryModelDeviceScope = 5346, + VulkanMemoryModelDeviceScopeKHR = 5346, + PhysicalStorageBufferAddresses = 5347, + PhysicalStorageBufferAddressesEXT = 5347, + ComputeDerivativeGroupLinearKHR = 5350, + ComputeDerivativeGroupLinearNV = 5350, + RayTracingProvisionalKHR = 5353, + CooperativeMatrixNV = 5357, + FragmentShaderSampleInterlockEXT = 5363, + FragmentShaderShadingRateInterlockEXT = 5372, + ShaderSMBuiltinsNV = 5373, + FragmentShaderPixelInterlockEXT = 5378, + DemoteToHelperInvocation = 5379, + DemoteToHelperInvocationEXT = 5379, + DisplacementMicromapNV = 5380, + RayTracingOpacityMicromapEXT = 5381, + ShaderInvocationReorderNV = 5383, + ShaderInvocationReorderEXT = 5388, + BindlessTextureNV = 5390, + RayQueryPositionFetchKHR = 5391, + CooperativeVectorNV = 5394, + AtomicFloat16VectorNV = 5404, + RayTracingDisplacementMicromapNV = 5409, + RawAccessChainsNV = 5414, + RayTracingSpheresGeometryNV = 5418, + RayTracingLinearSweptSpheresGeometryNV = 5419, + LongVectorEXT = 5425, + Shader64BitIndexingEXT = 5426, + CooperativeMatrixReductionsNV = 5430, + CooperativeMatrixConversionsNV = 5431, + CooperativeMatrixPerElementOperationsNV = 5432, + CooperativeMatrixTensorAddressingNV = 5433, + CooperativeMatrixBlockLoadsNV = 5434, + CooperativeVectorTrainingNV = 5435, + RayTracingClusterAccelerationStructureNV = 5437, + TensorAddressingNV = 5439, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + SubgroupImageMediaBlockIOINTEL = 5579, + RoundToInfinityINTEL = 5582, + FloatingPointModeINTEL = 5583, + IntegerFunctions2INTEL = 5584, + FunctionPointersINTEL = 5603, + IndirectReferencesINTEL = 5604, + AsmINTEL = 5606, + AtomicFloat32MinMaxEXT = 5612, + AtomicFloat64MinMaxEXT = 5613, + AtomicFloat16MinMaxEXT = 5616, + VectorComputeINTEL = 5617, + VectorAnyINTEL = 5619, + ExpectAssumeKHR = 5629, + SubgroupAvcMotionEstimationINTEL = 5696, + SubgroupAvcMotionEstimationIntraINTEL = 5697, + SubgroupAvcMotionEstimationChromaINTEL = 5698, + VariableLengthArrayINTEL = 5817, + FunctionFloatControlINTEL = 5821, + FPGAMemoryAttributesINTEL = 5824, + FPFastMathModeINTEL = 5837, + ArbitraryPrecisionIntegersINTEL = 5844, + ArbitraryPrecisionFloatingPointINTEL = 5845, + UnstructuredLoopControlsINTEL = 5886, + FPGALoopControlsINTEL = 5888, + KernelAttributesINTEL = 5892, + FPGAKernelAttributesINTEL = 5897, + FPGAMemoryAccessesINTEL = 5898, + FPGAClusterAttributesINTEL = 5904, + LoopFuseINTEL = 5906, + FPGADSPControlINTEL = 5908, + MemoryAccessAliasingINTEL = 5910, + FPGAInvocationPipeliningAttributesINTEL = 5916, + FPGABufferLocationINTEL = 5920, + ArbitraryPrecisionFixedPointINTEL = 5922, + USMStorageClassesINTEL = 5935, + RuntimeAlignedAttributeINTEL = 5939, + IOPipesINTEL = 5943, + BlockingPipesINTEL = 5945, + FPGARegINTEL = 5948, + DotProductInputAll = 6016, + DotProductInputAllKHR = 6016, + DotProductInput4x8Bit = 6017, + DotProductInput4x8BitKHR = 6017, + DotProductInput4x8BitPacked = 6018, + DotProductInput4x8BitPackedKHR = 6018, + DotProduct = 6019, + DotProductKHR = 6019, + RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, + ReplicatedCompositesEXT = 6024, + BitInstructions = 6025, + GroupNonUniformRotateKHR = 6026, + FloatControls2 = 6029, + AtomicFloat32AddEXT = 6033, + AtomicFloat64AddEXT = 6034, + LongCompositesINTEL = 6089, + OptNoneEXT = 6094, + OptNoneINTEL = 6094, + AtomicFloat16AddEXT = 6095, + DebugInfoModuleINTEL = 6114, + BFloat16ConversionINTEL = 6115, + SplitBarrierINTEL = 6141, + ArithmeticFenceEXT = 6144, + FPGAClusterAttributesV2INTEL = 6150, + FPGAKernelAttributesv2INTEL = 6161, + FPMaxErrorINTEL = 6169, + FPGALatencyControlINTEL = 6171, + FPGAArgumentInterfacesINTEL = 6174, + GlobalVariableHostAccessINTEL = 6187, + GlobalVariableFPGADecorationsINTEL = 6189, + SubgroupBufferPrefetchINTEL = 6220, + Subgroup2DBlockIOINTEL = 6228, + Subgroup2DBlockTransformINTEL = 6229, + Subgroup2DBlockTransposeINTEL = 6230, + SubgroupMatrixMultiplyAccumulateINTEL = 6236, + GroupUniformArithmeticKHR = 6400, + MaskedGatherScatterINTEL = 6427, + CacheControlsINTEL = 6441, + RegisterLimitsINTEL = 6460, + Max = 0x7fffffff, +}; + +enum class RayFlagsShift : unsigned { + OpaqueKHR = 0, + NoOpaqueKHR = 1, + TerminateOnFirstHitKHR = 2, + SkipClosestHitShaderKHR = 3, + CullBackFacingTrianglesKHR = 4, + CullFrontFacingTrianglesKHR = 5, + CullOpaqueKHR = 6, + CullNoOpaqueKHR = 7, + SkipBuiltinPrimitivesNV = 8, + SkipTrianglesKHR = 8, + SkipAABBsKHR = 9, + ForceOpacityMicromap2StateEXT = 10, + Max = 0x7fffffff, +}; + +enum class RayFlagsMask : unsigned { + MaskNone = 0, + OpaqueKHR = 0x00000001, + NoOpaqueKHR = 0x00000002, + TerminateOnFirstHitKHR = 0x00000004, + SkipClosestHitShaderKHR = 0x00000008, + CullBackFacingTrianglesKHR = 0x00000010, + CullFrontFacingTrianglesKHR = 0x00000020, + CullOpaqueKHR = 0x00000040, + CullNoOpaqueKHR = 0x00000080, + SkipBuiltinPrimitivesNV = 0x00000100, + SkipTrianglesKHR = 0x00000100, + SkipAABBsKHR = 0x00000200, + ForceOpacityMicromap2StateEXT = 0x00000400, +}; + +enum class RayQueryIntersection : unsigned { + RayQueryCandidateIntersectionKHR = 0, + RayQueryCommittedIntersectionKHR = 1, + Max = 0x7fffffff, +}; + +enum class RayQueryCommittedIntersectionType : unsigned { + RayQueryCommittedIntersectionNoneKHR = 0, + RayQueryCommittedIntersectionTriangleKHR = 1, + RayQueryCommittedIntersectionGeneratedKHR = 2, + Max = 0x7fffffff, +}; + +enum class RayQueryCandidateIntersectionType : unsigned { + RayQueryCandidateIntersectionTriangleKHR = 0, + RayQueryCandidateIntersectionAABBKHR = 1, + Max = 0x7fffffff, +}; + +enum class FragmentShadingRateShift : unsigned { + Vertical2Pixels = 0, + Vertical4Pixels = 1, + Horizontal2Pixels = 2, + Horizontal4Pixels = 3, + Max = 0x7fffffff, +}; + +enum class FragmentShadingRateMask : unsigned { + MaskNone = 0, + Vertical2Pixels = 0x00000001, + Vertical4Pixels = 0x00000002, + Horizontal2Pixels = 0x00000004, + Horizontal4Pixels = 0x00000008, +}; + +enum class FPDenormMode : unsigned { + Preserve = 0, + FlushToZero = 1, + Max = 0x7fffffff, +}; + +enum class FPOperationMode : unsigned { + IEEE = 0, + ALT = 1, + Max = 0x7fffffff, +}; + +enum class QuantizationModes : unsigned { + TRN = 0, + TRN_ZERO = 1, + RND = 2, + RND_ZERO = 3, + RND_INF = 4, + RND_MIN_INF = 5, + RND_CONV = 6, + RND_CONV_ODD = 7, + Max = 0x7fffffff, +}; + +enum class OverflowModes : unsigned { + WRAP = 0, + SAT = 1, + SAT_ZERO = 2, + SAT_SYM = 3, + Max = 0x7fffffff, +}; + +enum class PackedVectorFormat : unsigned { + PackedVectorFormat4x8Bit = 0, + PackedVectorFormat4x8BitKHR = 0, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixOperandsShift : unsigned { + MatrixASignedComponentsKHR = 0, + MatrixBSignedComponentsKHR = 1, + MatrixCSignedComponentsKHR = 2, + MatrixResultSignedComponentsKHR = 3, + SaturatingAccumulationKHR = 4, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixOperandsMask : unsigned { + MaskNone = 0, + MatrixASignedComponentsKHR = 0x00000001, + MatrixBSignedComponentsKHR = 0x00000002, + MatrixCSignedComponentsKHR = 0x00000004, + MatrixResultSignedComponentsKHR = 0x00000008, + SaturatingAccumulationKHR = 0x00000010, +}; + +enum class CooperativeMatrixLayout : unsigned { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + RowBlockedInterleavedARM = 4202, + ColumnBlockedInterleavedARM = 4203, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixUse : unsigned { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixReduceShift : unsigned { + Row = 0, + Column = 1, + CooperativeMatrixReduce2x2 = 2, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixReduceMask : unsigned { + MaskNone = 0, + Row = 0x00000001, + Column = 0x00000002, + CooperativeMatrixReduce2x2 = 0x00000004, +}; + +enum class TensorClampMode : unsigned { + Undefined = 0, + Constant = 1, + ClampToEdge = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class TensorAddressingOperandsShift : unsigned { + TensorView = 0, + DecodeFunc = 1, + Max = 0x7fffffff, +}; + +enum class TensorAddressingOperandsMask : unsigned { + MaskNone = 0, + TensorView = 0x00000001, + DecodeFunc = 0x00000002, +}; + +enum class TensorOperandsShift : unsigned { + NontemporalARM = 0, + OutOfBoundsValueARM = 1, + Max = 0x7fffffff, +}; + +enum class TensorOperandsMask : unsigned { + MaskNone = 0, + NontemporalARM = 0x00000001, + OutOfBoundsValueARM = 0x00000002, +}; + +enum class InitializationModeQualifier : unsigned { + InitOnDeviceReprogramINTEL = 0, + InitOnDeviceResetINTEL = 1, + Max = 0x7fffffff, +}; + +enum class HostAccessQualifier : unsigned { + NoneINTEL = 0, + ReadINTEL = 1, + WriteINTEL = 2, + ReadWriteINTEL = 3, + Max = 0x7fffffff, +}; + +enum class LoadCacheControl : unsigned { + UncachedINTEL = 0, + CachedINTEL = 1, + StreamingINTEL = 2, + InvalidateAfterReadINTEL = 3, + ConstCachedINTEL = 4, + Max = 0x7fffffff, +}; + +enum class StoreCacheControl : unsigned { + UncachedINTEL = 0, + WriteThroughINTEL = 1, + WriteBackINTEL = 2, + StreamingINTEL = 3, + Max = 0x7fffffff, +}; + +enum class NamedMaximumNumberOfRegisters : unsigned { + AutoINTEL = 0, + Max = 0x7fffffff, +}; + +enum class MatrixMultiplyAccumulateOperandsShift : unsigned { + MatrixASignedComponentsINTEL = 0, + MatrixBSignedComponentsINTEL = 1, + MatrixCBFloat16INTEL = 2, + MatrixResultBFloat16INTEL = 3, + MatrixAPackedInt8INTEL = 4, + MatrixBPackedInt8INTEL = 5, + MatrixAPackedInt4INTEL = 6, + MatrixBPackedInt4INTEL = 7, + MatrixATF32INTEL = 8, + MatrixBTF32INTEL = 9, + MatrixAPackedFloat16INTEL = 10, + MatrixBPackedFloat16INTEL = 11, + MatrixAPackedBFloat16INTEL = 12, + MatrixBPackedBFloat16INTEL = 13, + Max = 0x7fffffff, +}; + +enum class MatrixMultiplyAccumulateOperandsMask : unsigned { + MaskNone = 0, + MatrixASignedComponentsINTEL = 0x00000001, + MatrixBSignedComponentsINTEL = 0x00000002, + MatrixCBFloat16INTEL = 0x00000004, + MatrixResultBFloat16INTEL = 0x00000008, + MatrixAPackedInt8INTEL = 0x00000010, + MatrixBPackedInt8INTEL = 0x00000020, + MatrixAPackedInt4INTEL = 0x00000040, + MatrixBPackedInt4INTEL = 0x00000080, + MatrixATF32INTEL = 0x00000100, + MatrixBTF32INTEL = 0x00000200, + MatrixAPackedFloat16INTEL = 0x00000400, + MatrixBPackedFloat16INTEL = 0x00000800, + MatrixAPackedBFloat16INTEL = 0x00001000, + MatrixBPackedBFloat16INTEL = 0x00002000, +}; + +enum class RawAccessChainOperandsShift : unsigned { + RobustnessPerComponentNV = 0, + RobustnessPerElementNV = 1, + Max = 0x7fffffff, +}; + +enum class RawAccessChainOperandsMask : unsigned { + MaskNone = 0, + RobustnessPerComponentNV = 0x00000001, + RobustnessPerElementNV = 0x00000002, +}; + +enum class FPEncoding : unsigned { + BFloat16KHR = 0, + Float8E4M3EXT = 4214, + Float8E5M2EXT = 4215, + Max = 0x7fffffff, +}; + +enum class CooperativeVectorMatrixLayout : unsigned { + RowMajorNV = 0, + ColumnMajorNV = 1, + InferencingOptimalNV = 2, + TrainingOptimalNV = 3, + Max = 0x7fffffff, +}; + +enum class ComponentType : unsigned { + Float16NV = 0, + Float32NV = 1, + Float64NV = 2, + SignedInt8NV = 3, + SignedInt16NV = 4, + SignedInt32NV = 5, + SignedInt64NV = 6, + UnsignedInt8NV = 7, + UnsignedInt16NV = 8, + UnsignedInt32NV = 9, + UnsignedInt64NV = 10, + SignedInt8PackedNV = 1000491000, + UnsignedInt8PackedNV = 1000491001, + FloatE4M3NV = 1000491002, + FloatE5M2NV = 1000491003, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, + OpCopyLogical = 400, + OpPtrEqual = 401, + OpPtrNotEqual = 402, + OpPtrDiff = 403, + OpColorAttachmentReadEXT = 4160, + OpDepthAttachmentReadEXT = 4161, + OpStencilAttachmentReadEXT = 4162, + OpTypeTensorARM = 4163, + OpTensorReadARM = 4164, + OpTensorWriteARM = 4165, + OpTensorQuerySizeARM = 4166, + OpTerminateInvocation = 4416, + OpTypeUntypedPointerKHR = 4417, + OpUntypedVariableKHR = 4418, + OpUntypedAccessChainKHR = 4419, + OpUntypedInBoundsAccessChainKHR = 4420, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpUntypedPtrAccessChainKHR = 4423, + OpUntypedInBoundsPtrAccessChainKHR = 4424, + OpUntypedArrayLengthKHR = 4425, + OpUntypedPrefetchKHR = 4426, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpGroupNonUniformRotateKHR = 4431, + OpSubgroupReadInvocationKHR = 4432, + OpExtInstWithForwardRefsKHR = 4433, + OpTraceRayKHR = 4445, + OpExecuteCallableKHR = 4446, + OpConvertUToAccelerationStructureKHR = 4447, + OpIgnoreIntersectionKHR = 4448, + OpTerminateRayKHR = 4449, + OpSDot = 4450, + OpSDotKHR = 4450, + OpUDot = 4451, + OpUDotKHR = 4451, + OpSUDot = 4452, + OpSUDotKHR = 4452, + OpSDotAccSat = 4453, + OpSDotAccSatKHR = 4453, + OpUDotAccSat = 4454, + OpUDotAccSatKHR = 4454, + OpSUDotAccSat = 4455, + OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, + OpTypeRayQueryKHR = 4472, + OpRayQueryInitializeKHR = 4473, + OpRayQueryTerminateKHR = 4474, + OpRayQueryGenerateIntersectionKHR = 4475, + OpRayQueryConfirmIntersectionKHR = 4476, + OpRayQueryProceedKHR = 4477, + OpRayQueryGetIntersectionTypeKHR = 4479, + OpImageSampleWeightedQCOM = 4480, + OpImageBoxFilterQCOM = 4481, + OpImageBlockMatchSSDQCOM = 4482, + OpImageBlockMatchSADQCOM = 4483, + OpBitCastArrayQCOM = 4497, + OpImageBlockMatchWindowSSDQCOM = 4500, + OpImageBlockMatchWindowSADQCOM = 4501, + OpImageBlockMatchGatherSSDQCOM = 4502, + OpImageBlockMatchGatherSADQCOM = 4503, + OpCompositeConstructCoopMatQCOM = 4540, + OpCompositeExtractCoopMatQCOM = 4541, + OpExtractSubArrayQCOM = 4542, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpReadClockKHR = 5056, + OpAllocateNodePayloadsAMDX = 5074, + OpEnqueueNodePayloadsAMDX = 5075, + OpTypeNodePayloadArrayAMDX = 5076, + OpFinishWritingNodePayloadAMDX = 5078, + OpNodePayloadArrayLengthAMDX = 5090, + OpIsNodePayloadValidAMDX = 5101, + OpConstantStringAMDX = 5103, + OpSpecConstantStringAMDX = 5104, + OpGroupNonUniformQuadAllKHR = 5110, + OpGroupNonUniformQuadAnyKHR = 5111, + OpHitObjectRecordHitMotionNV = 5249, + OpHitObjectRecordHitWithIndexMotionNV = 5250, + OpHitObjectRecordMissMotionNV = 5251, + OpHitObjectGetWorldToObjectNV = 5252, + OpHitObjectGetObjectToWorldNV = 5253, + OpHitObjectGetObjectRayDirectionNV = 5254, + OpHitObjectGetObjectRayOriginNV = 5255, + OpHitObjectTraceRayMotionNV = 5256, + OpHitObjectGetShaderRecordBufferHandleNV = 5257, + OpHitObjectGetShaderBindingTableRecordIndexNV = 5258, + OpHitObjectRecordEmptyNV = 5259, + OpHitObjectTraceRayNV = 5260, + OpHitObjectRecordHitNV = 5261, + OpHitObjectRecordHitWithIndexNV = 5262, + OpHitObjectRecordMissNV = 5263, + OpHitObjectExecuteShaderNV = 5264, + OpHitObjectGetCurrentTimeNV = 5265, + OpHitObjectGetAttributesNV = 5266, + OpHitObjectGetHitKindNV = 5267, + OpHitObjectGetPrimitiveIndexNV = 5268, + OpHitObjectGetGeometryIndexNV = 5269, + OpHitObjectGetInstanceIdNV = 5270, + OpHitObjectGetInstanceCustomIndexNV = 5271, + OpHitObjectGetWorldRayDirectionNV = 5272, + OpHitObjectGetWorldRayOriginNV = 5273, + OpHitObjectGetRayTMaxNV = 5274, + OpHitObjectGetRayTMinNV = 5275, + OpHitObjectIsEmptyNV = 5276, + OpHitObjectIsHitNV = 5277, + OpHitObjectIsMissNV = 5278, + OpReorderThreadWithHitObjectNV = 5279, + OpReorderThreadWithHintNV = 5280, + OpTypeHitObjectNV = 5281, + OpImageSampleFootprintNV = 5283, + OpTypeCooperativeVectorNV = 5288, + OpTypeVectorIdEXT = 5288, + OpCooperativeVectorMatrixMulNV = 5289, + OpCooperativeVectorOuterProductAccumulateNV = 5290, + OpCooperativeVectorReduceSumAccumulateNV = 5291, + OpCooperativeVectorMatrixMulAddNV = 5292, + OpCooperativeMatrixConvertNV = 5293, + OpEmitMeshTasksEXT = 5294, + OpSetMeshOutputsEXT = 5295, + OpGroupNonUniformPartitionNV = 5296, + OpWritePackedPrimitiveIndices4x8NV = 5299, + OpFetchMicroTriangleVertexPositionNV = 5300, + OpFetchMicroTriangleVertexBarycentricNV = 5301, + OpCooperativeVectorLoadNV = 5302, + OpCooperativeVectorStoreNV = 5303, + OpHitObjectRecordFromQueryEXT = 5304, + OpHitObjectRecordMissEXT = 5305, + OpHitObjectRecordMissMotionEXT = 5306, + OpHitObjectGetIntersectionTriangleVertexPositionsEXT = 5307, + OpHitObjectGetRayFlagsEXT = 5308, + OpHitObjectSetShaderBindingTableRecordIndexEXT = 5309, + OpHitObjectReorderExecuteShaderEXT = 5310, + OpHitObjectTraceReorderExecuteEXT = 5311, + OpHitObjectTraceMotionReorderExecuteEXT = 5312, + OpTypeHitObjectEXT = 5313, + OpReorderThreadWithHintEXT = 5314, + OpReorderThreadWithHitObjectEXT = 5315, + OpHitObjectTraceRayEXT = 5316, + OpHitObjectTraceRayMotionEXT = 5317, + OpHitObjectRecordEmptyEXT = 5318, + OpHitObjectExecuteShaderEXT = 5319, + OpHitObjectGetCurrentTimeEXT = 5320, + OpHitObjectGetAttributesEXT = 5321, + OpHitObjectGetHitKindEXT = 5322, + OpHitObjectGetPrimitiveIndexEXT = 5323, + OpHitObjectGetGeometryIndexEXT = 5324, + OpHitObjectGetInstanceIdEXT = 5325, + OpHitObjectGetInstanceCustomIndexEXT = 5326, + OpHitObjectGetObjectRayOriginEXT = 5327, + OpHitObjectGetObjectRayDirectionEXT = 5328, + OpHitObjectGetWorldRayDirectionEXT = 5329, + OpHitObjectGetWorldRayOriginEXT = 5330, + OpHitObjectGetObjectToWorldEXT = 5331, + OpHitObjectGetWorldToObjectEXT = 5332, + OpHitObjectGetRayTMaxEXT = 5333, + OpReportIntersectionKHR = 5334, + OpReportIntersectionNV = 5334, + OpIgnoreIntersectionNV = 5335, + OpTerminateRayNV = 5336, + OpTraceNV = 5337, + OpTraceMotionNV = 5338, + OpTraceRayMotionNV = 5339, + OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340, + OpTypeAccelerationStructureKHR = 5341, + OpTypeAccelerationStructureNV = 5341, + OpExecuteCallableNV = 5344, + OpRayQueryGetClusterIdNV = 5345, + OpHitObjectGetClusterIdNV = 5346, + OpHitObjectGetRayTMinEXT = 5347, + OpHitObjectGetShaderBindingTableRecordIndexEXT = 5348, + OpHitObjectGetShaderRecordBufferHandleEXT = 5349, + OpHitObjectIsEmptyEXT = 5350, + OpHitObjectIsHitEXT = 5351, + OpHitObjectIsMissEXT = 5352, + OpTypeCooperativeMatrixNV = 5358, + OpCooperativeMatrixLoadNV = 5359, + OpCooperativeMatrixStoreNV = 5360, + OpCooperativeMatrixMulAddNV = 5361, + OpCooperativeMatrixLengthNV = 5362, + OpBeginInvocationInterlockEXT = 5364, + OpEndInvocationInterlockEXT = 5365, + OpCooperativeMatrixReduceNV = 5366, + OpCooperativeMatrixLoadTensorNV = 5367, + OpCooperativeMatrixStoreTensorNV = 5368, + OpCooperativeMatrixPerElementOpNV = 5369, + OpTypeTensorLayoutNV = 5370, + OpTypeTensorViewNV = 5371, + OpCreateTensorLayoutNV = 5372, + OpTensorLayoutSetDimensionNV = 5373, + OpTensorLayoutSetStrideNV = 5374, + OpTensorLayoutSliceNV = 5375, + OpTensorLayoutSetClampValueNV = 5376, + OpCreateTensorViewNV = 5377, + OpTensorViewSetDimensionNV = 5378, + OpTensorViewSetStrideNV = 5379, + OpDemoteToHelperInvocation = 5380, + OpDemoteToHelperInvocationEXT = 5380, + OpIsHelperInvocationEXT = 5381, + OpTensorViewSetClipNV = 5382, + OpTensorLayoutSetBlockSizeNV = 5384, + OpCooperativeMatrixTransposeNV = 5390, + OpConvertUToImageNV = 5391, + OpConvertUToSamplerNV = 5392, + OpConvertImageToUNV = 5393, + OpConvertSamplerToUNV = 5394, + OpConvertUToSampledImageNV = 5395, + OpConvertSampledImageToUNV = 5396, + OpSamplerImageAddressingModeNV = 5397, + OpRawAccessChainNV = 5398, + OpRayQueryGetIntersectionSpherePositionNV = 5427, + OpRayQueryGetIntersectionSphereRadiusNV = 5428, + OpRayQueryGetIntersectionLSSPositionsNV = 5429, + OpRayQueryGetIntersectionLSSRadiiNV = 5430, + OpRayQueryGetIntersectionLSSHitValueNV = 5431, + OpHitObjectGetSpherePositionNV = 5432, + OpHitObjectGetSphereRadiusNV = 5433, + OpHitObjectGetLSSPositionsNV = 5434, + OpHitObjectGetLSSRadiiNV = 5435, + OpHitObjectIsSphereHitNV = 5436, + OpHitObjectIsLSSHitNV = 5437, + OpRayQueryIsSphereHitNV = 5438, + OpRayQueryIsLSSHitNV = 5439, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpSubgroupImageMediaBlockReadINTEL = 5580, + OpSubgroupImageMediaBlockWriteINTEL = 5581, + OpUCountLeadingZerosINTEL = 5585, + OpUCountTrailingZerosINTEL = 5586, + OpAbsISubINTEL = 5587, + OpAbsUSubINTEL = 5588, + OpIAddSatINTEL = 5589, + OpUAddSatINTEL = 5590, + OpIAverageINTEL = 5591, + OpUAverageINTEL = 5592, + OpIAverageRoundedINTEL = 5593, + OpUAverageRoundedINTEL = 5594, + OpISubSatINTEL = 5595, + OpUSubSatINTEL = 5596, + OpIMul32x16INTEL = 5597, + OpUMul32x16INTEL = 5598, + OpConstantFunctionPointerINTEL = 5600, + OpFunctionPointerCallINTEL = 5601, + OpAsmTargetINTEL = 5609, + OpAsmINTEL = 5610, + OpAsmCallINTEL = 5611, + OpAtomicFMinEXT = 5614, + OpAtomicFMaxEXT = 5615, + OpAssumeTrueKHR = 5630, + OpExpectKHR = 5631, + OpDecorateString = 5632, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateString = 5633, + OpMemberDecorateStringGOOGLE = 5633, + OpVmeImageINTEL = 5699, + OpTypeVmeImageINTEL = 5700, + OpTypeAvcImePayloadINTEL = 5701, + OpTypeAvcRefPayloadINTEL = 5702, + OpTypeAvcSicPayloadINTEL = 5703, + OpTypeAvcMcePayloadINTEL = 5704, + OpTypeAvcMceResultINTEL = 5705, + OpTypeAvcImeResultINTEL = 5706, + OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, + OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, + OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, + OpTypeAvcImeDualReferenceStreaminINTEL = 5710, + OpTypeAvcRefResultINTEL = 5711, + OpTypeAvcSicResultINTEL = 5712, + OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, + OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, + OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, + OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, + OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, + OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, + OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, + OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, + OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, + OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, + OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, + OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, + OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, + OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, + OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, + OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, + OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, + OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, + OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, + OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, + OpSubgroupAvcMceConvertToImeResultINTEL = 5733, + OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, + OpSubgroupAvcMceConvertToRefResultINTEL = 5735, + OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, + OpSubgroupAvcMceConvertToSicResultINTEL = 5737, + OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, + OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, + OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, + OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, + OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, + OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, + OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, + OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, + OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, + OpSubgroupAvcImeInitializeINTEL = 5747, + OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, + OpSubgroupAvcImeSetDualReferenceINTEL = 5749, + OpSubgroupAvcImeRefWindowSizeINTEL = 5750, + OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, + OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, + OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, + OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, + OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, + OpSubgroupAvcImeSetWeightedSadINTEL = 5756, + OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, + OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, + OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, + OpSubgroupAvcImeConvertToMceResultINTEL = 5765, + OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, + OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, + OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, + OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, + OpSubgroupAvcImeGetBorderReachedINTEL = 5776, + OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, + OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, + OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, + OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, + OpSubgroupAvcFmeInitializeINTEL = 5781, + OpSubgroupAvcBmeInitializeINTEL = 5782, + OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, + OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, + OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, + OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, + OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, + OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, + OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, + OpSubgroupAvcRefConvertToMceResultINTEL = 5790, + OpSubgroupAvcSicInitializeINTEL = 5791, + OpSubgroupAvcSicConfigureSkcINTEL = 5792, + OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, + OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, + OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, + OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, + OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, + OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, + OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, + OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, + OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, + OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, + OpSubgroupAvcSicEvaluateIpeINTEL = 5803, + OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, + OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, + OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, + OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, + OpSubgroupAvcSicConvertToMceResultINTEL = 5808, + OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, + OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, + OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, + OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, + OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, + OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, + OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, + OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, + OpVariableLengthArrayINTEL = 5818, + OpSaveMemoryINTEL = 5819, + OpRestoreMemoryINTEL = 5820, + OpArbitraryFloatSinCosPiINTEL = 5840, + OpArbitraryFloatCastINTEL = 5841, + OpArbitraryFloatCastFromIntINTEL = 5842, + OpArbitraryFloatCastToIntINTEL = 5843, + OpArbitraryFloatAddINTEL = 5846, + OpArbitraryFloatSubINTEL = 5847, + OpArbitraryFloatMulINTEL = 5848, + OpArbitraryFloatDivINTEL = 5849, + OpArbitraryFloatGTINTEL = 5850, + OpArbitraryFloatGEINTEL = 5851, + OpArbitraryFloatLTINTEL = 5852, + OpArbitraryFloatLEINTEL = 5853, + OpArbitraryFloatEQINTEL = 5854, + OpArbitraryFloatRecipINTEL = 5855, + OpArbitraryFloatRSqrtINTEL = 5856, + OpArbitraryFloatCbrtINTEL = 5857, + OpArbitraryFloatHypotINTEL = 5858, + OpArbitraryFloatSqrtINTEL = 5859, + OpArbitraryFloatLogINTEL = 5860, + OpArbitraryFloatLog2INTEL = 5861, + OpArbitraryFloatLog10INTEL = 5862, + OpArbitraryFloatLog1pINTEL = 5863, + OpArbitraryFloatExpINTEL = 5864, + OpArbitraryFloatExp2INTEL = 5865, + OpArbitraryFloatExp10INTEL = 5866, + OpArbitraryFloatExpm1INTEL = 5867, + OpArbitraryFloatSinINTEL = 5868, + OpArbitraryFloatCosINTEL = 5869, + OpArbitraryFloatSinCosINTEL = 5870, + OpArbitraryFloatSinPiINTEL = 5871, + OpArbitraryFloatCosPiINTEL = 5872, + OpArbitraryFloatASinINTEL = 5873, + OpArbitraryFloatASinPiINTEL = 5874, + OpArbitraryFloatACosINTEL = 5875, + OpArbitraryFloatACosPiINTEL = 5876, + OpArbitraryFloatATanINTEL = 5877, + OpArbitraryFloatATanPiINTEL = 5878, + OpArbitraryFloatATan2INTEL = 5879, + OpArbitraryFloatPowINTEL = 5880, + OpArbitraryFloatPowRINTEL = 5881, + OpArbitraryFloatPowNINTEL = 5882, + OpLoopControlINTEL = 5887, + OpAliasDomainDeclINTEL = 5911, + OpAliasScopeDeclINTEL = 5912, + OpAliasScopeListDeclINTEL = 5913, + OpFixedSqrtINTEL = 5923, + OpFixedRecipINTEL = 5924, + OpFixedRsqrtINTEL = 5925, + OpFixedSinINTEL = 5926, + OpFixedCosINTEL = 5927, + OpFixedSinCosINTEL = 5928, + OpFixedSinPiINTEL = 5929, + OpFixedCosPiINTEL = 5930, + OpFixedSinCosPiINTEL = 5931, + OpFixedLogINTEL = 5932, + OpFixedExpINTEL = 5933, + OpPtrCastToCrossWorkgroupINTEL = 5934, + OpCrossWorkgroupCastToPtrINTEL = 5938, + OpReadPipeBlockingINTEL = 5946, + OpWritePipeBlockingINTEL = 5947, + OpFPGARegINTEL = 5949, + OpRayQueryGetRayTMinKHR = 6016, + OpRayQueryGetRayFlagsKHR = 6017, + OpRayQueryGetIntersectionTKHR = 6018, + OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, + OpRayQueryGetIntersectionInstanceIdKHR = 6020, + OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, + OpRayQueryGetIntersectionGeometryIndexKHR = 6022, + OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, + OpRayQueryGetIntersectionBarycentricsKHR = 6024, + OpRayQueryGetIntersectionFrontFaceKHR = 6025, + OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, + OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, + OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, + OpRayQueryGetWorldRayDirectionKHR = 6029, + OpRayQueryGetWorldRayOriginKHR = 6030, + OpRayQueryGetIntersectionObjectToWorldKHR = 6031, + OpRayQueryGetIntersectionWorldToObjectKHR = 6032, + OpAtomicFAddEXT = 6035, + OpTypeBufferSurfaceINTEL = 6086, + OpTypeStructContinuedINTEL = 6090, + OpConstantCompositeContinuedINTEL = 6091, + OpSpecConstantCompositeContinuedINTEL = 6092, + OpCompositeConstructContinuedINTEL = 6096, + OpConvertFToBF16INTEL = 6116, + OpConvertBF16ToFINTEL = 6117, + OpControlBarrierArriveINTEL = 6142, + OpControlBarrierWaitINTEL = 6143, + OpArithmeticFenceEXT = 6145, + OpSubgroupBlockPrefetchINTEL = 6221, + OpSubgroup2DBlockLoadINTEL = 6231, + OpSubgroup2DBlockLoadTransformINTEL = 6232, + OpSubgroup2DBlockLoadTransposeINTEL = 6233, + OpSubgroup2DBlockPrefetchINTEL = 6234, + OpSubgroup2DBlockStoreINTEL = 6235, + OpSubgroupMatrixMultiplyAccumulateINTEL = 6237, + OpGroupIMulKHR = 6401, + OpGroupFMulKHR = 6402, + OpGroupBitwiseAndKHR = 6403, + OpGroupBitwiseOrKHR = 6404, + OpGroupBitwiseXorKHR = 6405, + OpGroupLogicalAndKHR = 6406, + OpGroupLogicalOrKHR = 6407, + OpGroupLogicalXorKHR = 6408, + OpMaskedGatherINTEL = 6428, + OpMaskedScatterINTEL = 6429, + Max = 0x7fffffff, +}; + +#ifdef SPV_ENABLE_UTILITY_CODE +#ifndef __cplusplus +#include +#endif +inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { + *hasResult = *hasResultType = false; + switch (opcode) { + default: /* unknown opcode */ break; + case Op::OpNop: *hasResult = false; *hasResultType = false; break; + case Op::OpUndef: *hasResult = true; *hasResultType = true; break; + case Op::OpSourceContinued: *hasResult = false; *hasResultType = false; break; + case Op::OpSource: *hasResult = false; *hasResultType = false; break; + case Op::OpSourceExtension: *hasResult = false; *hasResultType = false; break; + case Op::OpName: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberName: *hasResult = false; *hasResultType = false; break; + case Op::OpString: *hasResult = true; *hasResultType = false; break; + case Op::OpLine: *hasResult = false; *hasResultType = false; break; + case Op::OpExtension: *hasResult = false; *hasResultType = false; break; + case Op::OpExtInstImport: *hasResult = true; *hasResultType = false; break; + case Op::OpExtInst: *hasResult = true; *hasResultType = true; break; + case Op::OpMemoryModel: *hasResult = false; *hasResultType = false; break; + case Op::OpEntryPoint: *hasResult = false; *hasResultType = false; break; + case Op::OpExecutionMode: *hasResult = false; *hasResultType = false; break; + case Op::OpCapability: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeVoid: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeBool: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeInt: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeFloat: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeVector: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeMatrix: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeImage: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeSampler: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeSampledImage: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeArray: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeStruct: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeOpaque: *hasResult = true; *hasResultType = false; break; + case Op::OpTypePointer: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeFunction: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeEvent: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeReserveId: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeQueue: *hasResult = true; *hasResultType = false; break; + case Op::OpTypePipe: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break; + case Op::OpConstantTrue: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantFalse: *hasResult = true; *hasResultType = true; break; + case Op::OpConstant: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantComposite: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantSampler: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantNull: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstant: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantOp: *hasResult = true; *hasResultType = true; break; + case Op::OpFunction: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionParameter: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionEnd: *hasResult = false; *hasResultType = false; break; + case Op::OpFunctionCall: *hasResult = true; *hasResultType = true; break; + case Op::OpVariable: *hasResult = true; *hasResultType = true; break; + case Op::OpImageTexelPointer: *hasResult = true; *hasResultType = true; break; + case Op::OpLoad: *hasResult = true; *hasResultType = true; break; + case Op::OpStore: *hasResult = false; *hasResultType = false; break; + case Op::OpCopyMemory: *hasResult = false; *hasResultType = false; break; + case Op::OpCopyMemorySized: *hasResult = false; *hasResultType = false; break; + case Op::OpAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpArrayLength: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break; + case Op::OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpDecorationGroup: *hasResult = true; *hasResultType = false; break; + case Op::OpGroupDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorShuffle: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstruct: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeInsert: *hasResult = true; *hasResultType = true; break; + case Op::OpCopyObject: *hasResult = true; *hasResultType = true; break; + case Op::OpTranspose: *hasResult = true; *hasResultType = true; break; + case Op::OpSampledImage: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageFetch: *hasResult = true; *hasResultType = true; break; + case Op::OpImageGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageDrefGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageRead: *hasResult = true; *hasResultType = true; break; + case Op::OpImageWrite: *hasResult = false; *hasResultType = false; break; + case Op::OpImage: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryFormat: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryOrder: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySize: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryLevels: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySamples: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToU: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToS: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSToF: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToF: *hasResult = true; *hasResultType = true; break; + case Op::OpUConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpSConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpFConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpQuantizeToF16: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertPtrToU: *hasResult = true; *hasResultType = true; break; + case Op::OpSatConvertSToU: *hasResult = true; *hasResultType = true; break; + case Op::OpSatConvertUToS: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToPtr: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break; + case Op::OpBitcast: *hasResult = true; *hasResultType = true; break; + case Op::OpSNegate: *hasResult = true; *hasResultType = true; break; + case Op::OpFNegate: *hasResult = true; *hasResultType = true; break; + case Op::OpIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpISub: *hasResult = true; *hasResultType = true; break; + case Op::OpFSub: *hasResult = true; *hasResultType = true; break; + case Op::OpIMul: *hasResult = true; *hasResultType = true; break; + case Op::OpFMul: *hasResult = true; *hasResultType = true; break; + case Op::OpUDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpSDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpFDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpUMod: *hasResult = true; *hasResultType = true; break; + case Op::OpSRem: *hasResult = true; *hasResultType = true; break; + case Op::OpSMod: *hasResult = true; *hasResultType = true; break; + case Op::OpFRem: *hasResult = true; *hasResultType = true; break; + case Op::OpFMod: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break; + case Op::OpOuterProduct: *hasResult = true; *hasResultType = true; break; + case Op::OpDot: *hasResult = true; *hasResultType = true; break; + case Op::OpIAddCarry: *hasResult = true; *hasResultType = true; break; + case Op::OpISubBorrow: *hasResult = true; *hasResultType = true; break; + case Op::OpUMulExtended: *hasResult = true; *hasResultType = true; break; + case Op::OpSMulExtended: *hasResult = true; *hasResultType = true; break; + case Op::OpAny: *hasResult = true; *hasResultType = true; break; + case Op::OpAll: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNan: *hasResult = true; *hasResultType = true; break; + case Op::OpIsInf: *hasResult = true; *hasResultType = true; break; + case Op::OpIsFinite: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNormal: *hasResult = true; *hasResultType = true; break; + case Op::OpSignBitSet: *hasResult = true; *hasResultType = true; break; + case Op::OpLessOrGreater: *hasResult = true; *hasResultType = true; break; + case Op::OpOrdered: *hasResult = true; *hasResultType = true; break; + case Op::OpUnordered: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalOr: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalNot: *hasResult = true; *hasResultType = true; break; + case Op::OpSelect: *hasResult = true; *hasResultType = true; break; + case Op::OpIEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpINotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpUGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpSGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpULessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpSLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpULessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpSLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftRightLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseOr: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseXor: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpNot: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldInsert: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpBitReverse: *hasResult = true; *hasResultType = true; break; + case Op::OpBitCount: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdx: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdy: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidth: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdxFine: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdyFine: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidthFine: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdxCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdyCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidthCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpEmitVertex: *hasResult = false; *hasResultType = false; break; + case Op::OpEndPrimitive: *hasResult = false; *hasResultType = false; break; + case Op::OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break; + case Op::OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break; + case Op::OpControlBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpMemoryBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicLoad: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicStore: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicExchange: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicISub: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicOr: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicXor: *hasResult = true; *hasResultType = true; break; + case Op::OpPhi: *hasResult = true; *hasResultType = true; break; + case Op::OpLoopMerge: *hasResult = false; *hasResultType = false; break; + case Op::OpSelectionMerge: *hasResult = false; *hasResultType = false; break; + case Op::OpLabel: *hasResult = true; *hasResultType = false; break; + case Op::OpBranch: *hasResult = false; *hasResultType = false; break; + case Op::OpBranchConditional: *hasResult = false; *hasResultType = false; break; + case Op::OpSwitch: *hasResult = false; *hasResultType = false; break; + case Op::OpKill: *hasResult = false; *hasResultType = false; break; + case Op::OpReturn: *hasResult = false; *hasResultType = false; break; + case Op::OpReturnValue: *hasResult = false; *hasResultType = false; break; + case Op::OpUnreachable: *hasResult = false; *hasResultType = false; break; + case Op::OpLifetimeStart: *hasResult = false; *hasResultType = false; break; + case Op::OpLifetimeStop: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupAll: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupAny: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpReadPipe: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReservedReadPipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReservedWritePipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case Op::OpCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case Op::OpIsValidReserveId: *hasResult = true; *hasResultType = true; break; + case Op::OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case Op::OpEnqueueMarker: *hasResult = true; *hasResultType = true; break; + case Op::OpEnqueueKernel: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break; + case Op::OpRetainEvent: *hasResult = false; *hasResultType = false; break; + case Op::OpReleaseEvent: *hasResult = false; *hasResultType = false; break; + case Op::OpCreateUserEvent: *hasResult = true; *hasResultType = true; break; + case Op::OpIsValidEvent: *hasResult = true; *hasResultType = true; break; + case Op::OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break; + case Op::OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break; + case Op::OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break; + case Op::OpBuildNDRange: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseFetch: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break; + case Op::OpNoLine: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break; + case Op::OpImageSparseRead: *hasResult = true; *hasResultType = true; break; + case Op::OpSizeOf: *hasResult = true; *hasResultType = true; break; + case Op::OpTypePipeStorage: *hasResult = true; *hasResultType = false; break; + case Op::OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break; + case Op::OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break; + case Op::OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break; + case Op::OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpModuleProcessed: *hasResult = false; *hasResultType = false; break; + case Op::OpExecutionModeId: *hasResult = false; *hasResultType = false; break; + case Op::OpDecorateId: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break; + case Op::OpCopyLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrDiff: *hasResult = true; *hasResultType = true; break; + case Op::OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeTensorARM: *hasResult = true; *hasResultType = false; break; + case Op::OpTensorReadARM: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorWriteARM: *hasResult = false; *hasResultType = false; break; + case Op::OpTensorQuerySizeARM: *hasResult = true; *hasResultType = true; break; + case Op::OpTerminateInvocation: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedInBoundsAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedInBoundsPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedArrayLengthKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedPrefetchKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpTraceRayKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpSDot: *hasResult = true; *hasResultType = true; break; + case Op::OpUDot: *hasResult = true; *hasResultType = true; break; + case Op::OpSUDot: *hasResult = true; *hasResultType = true; break; + case Op::OpSDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpUDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstructReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleWeightedQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpBitCastArrayQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstructCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeExtractCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpExtractSubArrayQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpReadClockKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpAllocateNodePayloadsAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpEnqueueNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeNodePayloadArrayAMDX: *hasResult = true; *hasResultType = false; break; + case Op::OpFinishWritingNodePayloadAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpNodePayloadArrayLengthAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNodePayloadValidAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case Op::OpSpecConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case Op::OpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break; + case Op::OpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break; + case Op::OpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break; + case Op::OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeVectorNV: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeVectorMatrixMulNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeVectorOuterProductAccumulateNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeVectorReduceSumAccumulateNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeVectorMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixConvertNV: *hasResult = true; *hasResultType = true; break; + case Op::OpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; + case Op::OpFetchMicroTriangleVertexPositionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeVectorLoadNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeVectorStoreNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordFromQueryEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissMotionEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayFlagsEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectReorderExecuteShaderEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceReorderExecuteEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceMotionReorderExecuteEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeHitObjectEXT: *hasResult = true; *hasResultType = false; break; + case Op::OpReorderThreadWithHintEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpReorderThreadWithHitObjectEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayMotionEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordEmptyEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectExecuteShaderEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetCurrentTimeEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetAttributesEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetHitKindEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetPrimitiveIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetGeometryIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceIdEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceCustomIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayOriginEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayDirectionEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayDirectionEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayOriginEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectToWorldEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldToObjectEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMaxEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTerminateRayNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeAccelerationStructureKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGetClusterIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetClusterIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMinEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderRecordBufferHandleEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsEmptyEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsHitEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsMissEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break; + case Op::OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixReduceNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLoadTensorNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreTensorNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixPerElementOpNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeTensorLayoutNV: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeTensorViewNV: *hasResult = true; *hasResultType = false; break; + case Op::OpCreateTensorLayoutNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetDimensionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetStrideNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSliceNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetClampValueNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCreateTensorViewNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorViewSetDimensionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorViewSetStrideNV: *hasResult = true; *hasResultType = true; break; + case Op::OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break; + case Op::OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorViewSetClipNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetBlockSizeNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixTransposeNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break; + case Op::OpRawAccessChainNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionSpherePositionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionSphereRadiusNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionLSSPositionsNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionLSSRadiiNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionLSSHitValueNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetSpherePositionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetSphereRadiusNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetLSSPositionsNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetLSSRadiiNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsSphereHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsLSSHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryIsSphereHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryIsLSSHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAverageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAverageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpISubSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAsmTargetINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAsmINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpExpectKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpDecorateString: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberDecorateString: *hasResult = false; *hasResultType = false; break; + case Op::OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpCompositeConstructContinuedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToBF16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpArithmeticFenceEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockLoadINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockLoadTransformINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockLoadTransposeINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockStoreINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupMatrixMultiplyAccumulateINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break; + } +} +inline const char* SourceLanguageToString(SourceLanguage value) { + switch (value) { + case SourceLanguage::Unknown: return "Unknown"; + case SourceLanguage::ESSL: return "ESSL"; + case SourceLanguage::GLSL: return "GLSL"; + case SourceLanguage::OpenCL_C: return "OpenCL_C"; + case SourceLanguage::OpenCL_CPP: return "OpenCL_CPP"; + case SourceLanguage::HLSL: return "HLSL"; + case SourceLanguage::CPP_for_OpenCL: return "CPP_for_OpenCL"; + case SourceLanguage::SYCL: return "SYCL"; + case SourceLanguage::HERO_C: return "HERO_C"; + case SourceLanguage::NZSL: return "NZSL"; + case SourceLanguage::WGSL: return "WGSL"; + case SourceLanguage::Slang: return "Slang"; + case SourceLanguage::Zig: return "Zig"; + case SourceLanguage::Rust: return "Rust"; + default: return "Unknown"; + } +} + +inline const char* ExecutionModelToString(ExecutionModel value) { + switch (value) { + case ExecutionModel::Vertex: return "Vertex"; + case ExecutionModel::TessellationControl: return "TessellationControl"; + case ExecutionModel::TessellationEvaluation: return "TessellationEvaluation"; + case ExecutionModel::Geometry: return "Geometry"; + case ExecutionModel::Fragment: return "Fragment"; + case ExecutionModel::GLCompute: return "GLCompute"; + case ExecutionModel::Kernel: return "Kernel"; + case ExecutionModel::TaskNV: return "TaskNV"; + case ExecutionModel::MeshNV: return "MeshNV"; + case ExecutionModel::RayGenerationKHR: return "RayGenerationKHR"; + case ExecutionModel::IntersectionKHR: return "IntersectionKHR"; + case ExecutionModel::AnyHitKHR: return "AnyHitKHR"; + case ExecutionModel::ClosestHitKHR: return "ClosestHitKHR"; + case ExecutionModel::MissKHR: return "MissKHR"; + case ExecutionModel::CallableKHR: return "CallableKHR"; + case ExecutionModel::TaskEXT: return "TaskEXT"; + case ExecutionModel::MeshEXT: return "MeshEXT"; + default: return "Unknown"; + } +} + +inline const char* AddressingModelToString(AddressingModel value) { + switch (value) { + case AddressingModel::Logical: return "Logical"; + case AddressingModel::Physical32: return "Physical32"; + case AddressingModel::Physical64: return "Physical64"; + case AddressingModel::PhysicalStorageBuffer64: return "PhysicalStorageBuffer64"; + default: return "Unknown"; + } +} + +inline const char* MemoryModelToString(MemoryModel value) { + switch (value) { + case MemoryModel::Simple: return "Simple"; + case MemoryModel::GLSL450: return "GLSL450"; + case MemoryModel::OpenCL: return "OpenCL"; + case MemoryModel::Vulkan: return "Vulkan"; + default: return "Unknown"; + } +} + +inline const char* ExecutionModeToString(ExecutionMode value) { + switch (value) { + case ExecutionMode::Invocations: return "Invocations"; + case ExecutionMode::SpacingEqual: return "SpacingEqual"; + case ExecutionMode::SpacingFractionalEven: return "SpacingFractionalEven"; + case ExecutionMode::SpacingFractionalOdd: return "SpacingFractionalOdd"; + case ExecutionMode::VertexOrderCw: return "VertexOrderCw"; + case ExecutionMode::VertexOrderCcw: return "VertexOrderCcw"; + case ExecutionMode::PixelCenterInteger: return "PixelCenterInteger"; + case ExecutionMode::OriginUpperLeft: return "OriginUpperLeft"; + case ExecutionMode::OriginLowerLeft: return "OriginLowerLeft"; + case ExecutionMode::EarlyFragmentTests: return "EarlyFragmentTests"; + case ExecutionMode::PointMode: return "PointMode"; + case ExecutionMode::Xfb: return "Xfb"; + case ExecutionMode::DepthReplacing: return "DepthReplacing"; + case ExecutionMode::DepthGreater: return "DepthGreater"; + case ExecutionMode::DepthLess: return "DepthLess"; + case ExecutionMode::DepthUnchanged: return "DepthUnchanged"; + case ExecutionMode::LocalSize: return "LocalSize"; + case ExecutionMode::LocalSizeHint: return "LocalSizeHint"; + case ExecutionMode::InputPoints: return "InputPoints"; + case ExecutionMode::InputLines: return "InputLines"; + case ExecutionMode::InputLinesAdjacency: return "InputLinesAdjacency"; + case ExecutionMode::Triangles: return "Triangles"; + case ExecutionMode::InputTrianglesAdjacency: return "InputTrianglesAdjacency"; + case ExecutionMode::Quads: return "Quads"; + case ExecutionMode::Isolines: return "Isolines"; + case ExecutionMode::OutputVertices: return "OutputVertices"; + case ExecutionMode::OutputPoints: return "OutputPoints"; + case ExecutionMode::OutputLineStrip: return "OutputLineStrip"; + case ExecutionMode::OutputTriangleStrip: return "OutputTriangleStrip"; + case ExecutionMode::VecTypeHint: return "VecTypeHint"; + case ExecutionMode::ContractionOff: return "ContractionOff"; + case ExecutionMode::Initializer: return "Initializer"; + case ExecutionMode::Finalizer: return "Finalizer"; + case ExecutionMode::SubgroupSize: return "SubgroupSize"; + case ExecutionMode::SubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup"; + case ExecutionMode::SubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId"; + case ExecutionMode::LocalSizeId: return "LocalSizeId"; + case ExecutionMode::LocalSizeHintId: return "LocalSizeHintId"; + case ExecutionMode::NonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT"; + case ExecutionMode::NonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; + case ExecutionMode::NonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; + case ExecutionMode::SubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlowKHR"; + case ExecutionMode::PostDepthCoverage: return "PostDepthCoverage"; + case ExecutionMode::DenormPreserve: return "DenormPreserve"; + case ExecutionMode::DenormFlushToZero: return "DenormFlushToZero"; + case ExecutionMode::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case ExecutionMode::RoundingModeRTE: return "RoundingModeRTE"; + case ExecutionMode::RoundingModeRTZ: return "RoundingModeRTZ"; + case ExecutionMode::NonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM"; + case ExecutionMode::TileShadingRateQCOM: return "TileShadingRateQCOM"; + case ExecutionMode::EarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD"; + case ExecutionMode::StencilRefReplacingEXT: return "StencilRefReplacingEXT"; + case ExecutionMode::CoalescingAMDX: return "CoalescingAMDX"; + case ExecutionMode::IsApiEntryAMDX: return "IsApiEntryAMDX"; + case ExecutionMode::MaxNodeRecursionAMDX: return "MaxNodeRecursionAMDX"; + case ExecutionMode::StaticNumWorkgroupsAMDX: return "StaticNumWorkgroupsAMDX"; + case ExecutionMode::ShaderIndexAMDX: return "ShaderIndexAMDX"; + case ExecutionMode::MaxNumWorkgroupsAMDX: return "MaxNumWorkgroupsAMDX"; + case ExecutionMode::StencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD"; + case ExecutionMode::StencilRefGreaterFrontAMD: return "StencilRefGreaterFrontAMD"; + case ExecutionMode::StencilRefLessFrontAMD: return "StencilRefLessFrontAMD"; + case ExecutionMode::StencilRefUnchangedBackAMD: return "StencilRefUnchangedBackAMD"; + case ExecutionMode::StencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD"; + case ExecutionMode::StencilRefLessBackAMD: return "StencilRefLessBackAMD"; + case ExecutionMode::QuadDerivativesKHR: return "QuadDerivativesKHR"; + case ExecutionMode::RequireFullQuadsKHR: return "RequireFullQuadsKHR"; + case ExecutionMode::SharesInputWithAMDX: return "SharesInputWithAMDX"; + case ExecutionMode::OutputLinesEXT: return "OutputLinesEXT"; + case ExecutionMode::OutputPrimitivesEXT: return "OutputPrimitivesEXT"; + case ExecutionMode::DerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR"; + case ExecutionMode::DerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR"; + case ExecutionMode::OutputTrianglesEXT: return "OutputTrianglesEXT"; + case ExecutionMode::PixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT"; + case ExecutionMode::PixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT"; + case ExecutionMode::SampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT"; + case ExecutionMode::SampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT"; + case ExecutionMode::ShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT"; + case ExecutionMode::ShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT"; + case ExecutionMode::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT"; + case ExecutionMode::SharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL"; + case ExecutionMode::RoundingModeRTPINTEL: return "RoundingModeRTPINTEL"; + case ExecutionMode::RoundingModeRTNINTEL: return "RoundingModeRTNINTEL"; + case ExecutionMode::FloatingPointModeALTINTEL: return "FloatingPointModeALTINTEL"; + case ExecutionMode::FloatingPointModeIEEEINTEL: return "FloatingPointModeIEEEINTEL"; + case ExecutionMode::MaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL"; + case ExecutionMode::MaxWorkDimINTEL: return "MaxWorkDimINTEL"; + case ExecutionMode::NoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL"; + case ExecutionMode::NumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL"; + case ExecutionMode::SchedulerTargetFmaxMhzINTEL: return "SchedulerTargetFmaxMhzINTEL"; + case ExecutionMode::MaximallyReconvergesKHR: return "MaximallyReconvergesKHR"; + case ExecutionMode::FPFastMathDefault: return "FPFastMathDefault"; + case ExecutionMode::StreamingInterfaceINTEL: return "StreamingInterfaceINTEL"; + case ExecutionMode::RegisterMapInterfaceINTEL: return "RegisterMapInterfaceINTEL"; + case ExecutionMode::NamedBarrierCountINTEL: return "NamedBarrierCountINTEL"; + case ExecutionMode::MaximumRegistersINTEL: return "MaximumRegistersINTEL"; + case ExecutionMode::MaximumRegistersIdINTEL: return "MaximumRegistersIdINTEL"; + case ExecutionMode::NamedMaximumRegistersINTEL: return "NamedMaximumRegistersINTEL"; + default: return "Unknown"; + } +} + +inline const char* StorageClassToString(StorageClass value) { + switch (value) { + case StorageClass::UniformConstant: return "UniformConstant"; + case StorageClass::Input: return "Input"; + case StorageClass::Uniform: return "Uniform"; + case StorageClass::Output: return "Output"; + case StorageClass::Workgroup: return "Workgroup"; + case StorageClass::CrossWorkgroup: return "CrossWorkgroup"; + case StorageClass::Private: return "Private"; + case StorageClass::Function: return "Function"; + case StorageClass::Generic: return "Generic"; + case StorageClass::PushConstant: return "PushConstant"; + case StorageClass::AtomicCounter: return "AtomicCounter"; + case StorageClass::Image: return "Image"; + case StorageClass::StorageBuffer: return "StorageBuffer"; + case StorageClass::TileImageEXT: return "TileImageEXT"; + case StorageClass::TileAttachmentQCOM: return "TileAttachmentQCOM"; + case StorageClass::NodePayloadAMDX: return "NodePayloadAMDX"; + case StorageClass::CallableDataKHR: return "CallableDataKHR"; + case StorageClass::IncomingCallableDataKHR: return "IncomingCallableDataKHR"; + case StorageClass::RayPayloadKHR: return "RayPayloadKHR"; + case StorageClass::HitAttributeKHR: return "HitAttributeKHR"; + case StorageClass::IncomingRayPayloadKHR: return "IncomingRayPayloadKHR"; + case StorageClass::ShaderRecordBufferKHR: return "ShaderRecordBufferKHR"; + case StorageClass::PhysicalStorageBuffer: return "PhysicalStorageBuffer"; + case StorageClass::HitObjectAttributeNV: return "HitObjectAttributeNV"; + case StorageClass::TaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; + case StorageClass::HitObjectAttributeEXT: return "HitObjectAttributeEXT"; + case StorageClass::CodeSectionINTEL: return "CodeSectionINTEL"; + case StorageClass::DeviceOnlyINTEL: return "DeviceOnlyINTEL"; + case StorageClass::HostOnlyINTEL: return "HostOnlyINTEL"; + default: return "Unknown"; + } +} + +inline const char* DimToString(Dim value) { + switch (value) { + case Dim::Dim1D: return "1D"; + case Dim::Dim2D: return "2D"; + case Dim::Dim3D: return "3D"; + case Dim::Cube: return "Cube"; + case Dim::Rect: return "Rect"; + case Dim::Buffer: return "Buffer"; + case Dim::SubpassData: return "SubpassData"; + case Dim::TileImageDataEXT: return "TileImageDataEXT"; + default: return "Unknown"; + } +} + +inline const char* SamplerAddressingModeToString(SamplerAddressingMode value) { + switch (value) { + case SamplerAddressingMode::None: return "None"; + case SamplerAddressingMode::ClampToEdge: return "ClampToEdge"; + case SamplerAddressingMode::Clamp: return "Clamp"; + case SamplerAddressingMode::Repeat: return "Repeat"; + case SamplerAddressingMode::RepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* SamplerFilterModeToString(SamplerFilterMode value) { + switch (value) { + case SamplerFilterMode::Nearest: return "Nearest"; + case SamplerFilterMode::Linear: return "Linear"; + default: return "Unknown"; + } +} + +inline const char* ImageFormatToString(ImageFormat value) { + switch (value) { + case ImageFormat::Unknown: return "Unknown"; + case ImageFormat::Rgba32f: return "Rgba32f"; + case ImageFormat::Rgba16f: return "Rgba16f"; + case ImageFormat::R32f: return "R32f"; + case ImageFormat::Rgba8: return "Rgba8"; + case ImageFormat::Rgba8Snorm: return "Rgba8Snorm"; + case ImageFormat::Rg32f: return "Rg32f"; + case ImageFormat::Rg16f: return "Rg16f"; + case ImageFormat::R11fG11fB10f: return "R11fG11fB10f"; + case ImageFormat::R16f: return "R16f"; + case ImageFormat::Rgba16: return "Rgba16"; + case ImageFormat::Rgb10A2: return "Rgb10A2"; + case ImageFormat::Rg16: return "Rg16"; + case ImageFormat::Rg8: return "Rg8"; + case ImageFormat::R16: return "R16"; + case ImageFormat::R8: return "R8"; + case ImageFormat::Rgba16Snorm: return "Rgba16Snorm"; + case ImageFormat::Rg16Snorm: return "Rg16Snorm"; + case ImageFormat::Rg8Snorm: return "Rg8Snorm"; + case ImageFormat::R16Snorm: return "R16Snorm"; + case ImageFormat::R8Snorm: return "R8Snorm"; + case ImageFormat::Rgba32i: return "Rgba32i"; + case ImageFormat::Rgba16i: return "Rgba16i"; + case ImageFormat::Rgba8i: return "Rgba8i"; + case ImageFormat::R32i: return "R32i"; + case ImageFormat::Rg32i: return "Rg32i"; + case ImageFormat::Rg16i: return "Rg16i"; + case ImageFormat::Rg8i: return "Rg8i"; + case ImageFormat::R16i: return "R16i"; + case ImageFormat::R8i: return "R8i"; + case ImageFormat::Rgba32ui: return "Rgba32ui"; + case ImageFormat::Rgba16ui: return "Rgba16ui"; + case ImageFormat::Rgba8ui: return "Rgba8ui"; + case ImageFormat::R32ui: return "R32ui"; + case ImageFormat::Rgb10a2ui: return "Rgb10a2ui"; + case ImageFormat::Rg32ui: return "Rg32ui"; + case ImageFormat::Rg16ui: return "Rg16ui"; + case ImageFormat::Rg8ui: return "Rg8ui"; + case ImageFormat::R16ui: return "R16ui"; + case ImageFormat::R8ui: return "R8ui"; + case ImageFormat::R64ui: return "R64ui"; + case ImageFormat::R64i: return "R64i"; + default: return "Unknown"; + } +} + +inline const char* ImageChannelOrderToString(ImageChannelOrder value) { + switch (value) { + case ImageChannelOrder::R: return "R"; + case ImageChannelOrder::A: return "A"; + case ImageChannelOrder::RG: return "RG"; + case ImageChannelOrder::RA: return "RA"; + case ImageChannelOrder::RGB: return "RGB"; + case ImageChannelOrder::RGBA: return "RGBA"; + case ImageChannelOrder::BGRA: return "BGRA"; + case ImageChannelOrder::ARGB: return "ARGB"; + case ImageChannelOrder::Intensity: return "Intensity"; + case ImageChannelOrder::Luminance: return "Luminance"; + case ImageChannelOrder::Rx: return "Rx"; + case ImageChannelOrder::RGx: return "RGx"; + case ImageChannelOrder::RGBx: return "RGBx"; + case ImageChannelOrder::Depth: return "Depth"; + case ImageChannelOrder::DepthStencil: return "DepthStencil"; + case ImageChannelOrder::sRGB: return "sRGB"; + case ImageChannelOrder::sRGBx: return "sRGBx"; + case ImageChannelOrder::sRGBA: return "sRGBA"; + case ImageChannelOrder::sBGRA: return "sBGRA"; + case ImageChannelOrder::ABGR: return "ABGR"; + default: return "Unknown"; + } +} + +inline const char* ImageChannelDataTypeToString(ImageChannelDataType value) { + switch (value) { + case ImageChannelDataType::SnormInt8: return "SnormInt8"; + case ImageChannelDataType::SnormInt16: return "SnormInt16"; + case ImageChannelDataType::UnormInt8: return "UnormInt8"; + case ImageChannelDataType::UnormInt16: return "UnormInt16"; + case ImageChannelDataType::UnormShort565: return "UnormShort565"; + case ImageChannelDataType::UnormShort555: return "UnormShort555"; + case ImageChannelDataType::UnormInt101010: return "UnormInt101010"; + case ImageChannelDataType::SignedInt8: return "SignedInt8"; + case ImageChannelDataType::SignedInt16: return "SignedInt16"; + case ImageChannelDataType::SignedInt32: return "SignedInt32"; + case ImageChannelDataType::UnsignedInt8: return "UnsignedInt8"; + case ImageChannelDataType::UnsignedInt16: return "UnsignedInt16"; + case ImageChannelDataType::UnsignedInt32: return "UnsignedInt32"; + case ImageChannelDataType::HalfFloat: return "HalfFloat"; + case ImageChannelDataType::Float: return "Float"; + case ImageChannelDataType::UnormInt24: return "UnormInt24"; + case ImageChannelDataType::UnormInt101010_2: return "UnormInt101010_2"; + case ImageChannelDataType::UnsignedIntRaw10EXT: return "UnsignedIntRaw10EXT"; + case ImageChannelDataType::UnsignedIntRaw12EXT: return "UnsignedIntRaw12EXT"; + case ImageChannelDataType::UnormInt2_101010EXT: return "UnormInt2_101010EXT"; + default: return "Unknown"; + } +} + +inline const char* FPRoundingModeToString(FPRoundingMode value) { + switch (value) { + case FPRoundingMode::RTE: return "RTE"; + case FPRoundingMode::RTZ: return "RTZ"; + case FPRoundingMode::RTP: return "RTP"; + case FPRoundingMode::RTN: return "RTN"; + default: return "Unknown"; + } +} + +inline const char* LinkageTypeToString(LinkageType value) { + switch (value) { + case LinkageType::Export: return "Export"; + case LinkageType::Import: return "Import"; + case LinkageType::LinkOnceODR: return "LinkOnceODR"; + default: return "Unknown"; + } +} + +inline const char* AccessQualifierToString(AccessQualifier value) { + switch (value) { + case AccessQualifier::ReadOnly: return "ReadOnly"; + case AccessQualifier::WriteOnly: return "WriteOnly"; + case AccessQualifier::ReadWrite: return "ReadWrite"; + default: return "Unknown"; + } +} + +inline const char* FunctionParameterAttributeToString(FunctionParameterAttribute value) { + switch (value) { + case FunctionParameterAttribute::Zext: return "Zext"; + case FunctionParameterAttribute::Sext: return "Sext"; + case FunctionParameterAttribute::ByVal: return "ByVal"; + case FunctionParameterAttribute::Sret: return "Sret"; + case FunctionParameterAttribute::NoAlias: return "NoAlias"; + case FunctionParameterAttribute::NoCapture: return "NoCapture"; + case FunctionParameterAttribute::NoWrite: return "NoWrite"; + case FunctionParameterAttribute::NoReadWrite: return "NoReadWrite"; + case FunctionParameterAttribute::RuntimeAlignedINTEL: return "RuntimeAlignedINTEL"; + default: return "Unknown"; + } +} + +inline const char* DecorationToString(Decoration value) { + switch (value) { + case Decoration::RelaxedPrecision: return "RelaxedPrecision"; + case Decoration::SpecId: return "SpecId"; + case Decoration::Block: return "Block"; + case Decoration::BufferBlock: return "BufferBlock"; + case Decoration::RowMajor: return "RowMajor"; + case Decoration::ColMajor: return "ColMajor"; + case Decoration::ArrayStride: return "ArrayStride"; + case Decoration::MatrixStride: return "MatrixStride"; + case Decoration::GLSLShared: return "GLSLShared"; + case Decoration::GLSLPacked: return "GLSLPacked"; + case Decoration::CPacked: return "CPacked"; + case Decoration::BuiltIn: return "BuiltIn"; + case Decoration::NoPerspective: return "NoPerspective"; + case Decoration::Flat: return "Flat"; + case Decoration::Patch: return "Patch"; + case Decoration::Centroid: return "Centroid"; + case Decoration::Sample: return "Sample"; + case Decoration::Invariant: return "Invariant"; + case Decoration::Restrict: return "Restrict"; + case Decoration::Aliased: return "Aliased"; + case Decoration::Volatile: return "Volatile"; + case Decoration::Constant: return "Constant"; + case Decoration::Coherent: return "Coherent"; + case Decoration::NonWritable: return "NonWritable"; + case Decoration::NonReadable: return "NonReadable"; + case Decoration::Uniform: return "Uniform"; + case Decoration::UniformId: return "UniformId"; + case Decoration::SaturatedConversion: return "SaturatedConversion"; + case Decoration::Stream: return "Stream"; + case Decoration::Location: return "Location"; + case Decoration::Component: return "Component"; + case Decoration::Index: return "Index"; + case Decoration::Binding: return "Binding"; + case Decoration::DescriptorSet: return "DescriptorSet"; + case Decoration::Offset: return "Offset"; + case Decoration::XfbBuffer: return "XfbBuffer"; + case Decoration::XfbStride: return "XfbStride"; + case Decoration::FuncParamAttr: return "FuncParamAttr"; + case Decoration::FPRoundingMode: return "FPRoundingMode"; + case Decoration::FPFastMathMode: return "FPFastMathMode"; + case Decoration::LinkageAttributes: return "LinkageAttributes"; + case Decoration::NoContraction: return "NoContraction"; + case Decoration::InputAttachmentIndex: return "InputAttachmentIndex"; + case Decoration::Alignment: return "Alignment"; + case Decoration::MaxByteOffset: return "MaxByteOffset"; + case Decoration::AlignmentId: return "AlignmentId"; + case Decoration::MaxByteOffsetId: return "MaxByteOffsetId"; + case Decoration::SaturatedToLargestFloat8NormalConversionEXT: return "SaturatedToLargestFloat8NormalConversionEXT"; + case Decoration::NoSignedWrap: return "NoSignedWrap"; + case Decoration::NoUnsignedWrap: return "NoUnsignedWrap"; + case Decoration::WeightTextureQCOM: return "WeightTextureQCOM"; + case Decoration::BlockMatchTextureQCOM: return "BlockMatchTextureQCOM"; + case Decoration::BlockMatchSamplerQCOM: return "BlockMatchSamplerQCOM"; + case Decoration::ExplicitInterpAMD: return "ExplicitInterpAMD"; + case Decoration::NodeSharesPayloadLimitsWithAMDX: return "NodeSharesPayloadLimitsWithAMDX"; + case Decoration::NodeMaxPayloadsAMDX: return "NodeMaxPayloadsAMDX"; + case Decoration::TrackFinishWritingAMDX: return "TrackFinishWritingAMDX"; + case Decoration::PayloadNodeNameAMDX: return "PayloadNodeNameAMDX"; + case Decoration::PayloadNodeBaseIndexAMDX: return "PayloadNodeBaseIndexAMDX"; + case Decoration::PayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX"; + case Decoration::PayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX"; + case Decoration::PayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX"; + case Decoration::OverrideCoverageNV: return "OverrideCoverageNV"; + case Decoration::PassthroughNV: return "PassthroughNV"; + case Decoration::ViewportRelativeNV: return "ViewportRelativeNV"; + case Decoration::SecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case Decoration::PerPrimitiveEXT: return "PerPrimitiveEXT"; + case Decoration::PerViewNV: return "PerViewNV"; + case Decoration::PerTaskNV: return "PerTaskNV"; + case Decoration::PerVertexKHR: return "PerVertexKHR"; + case Decoration::NonUniform: return "NonUniform"; + case Decoration::RestrictPointer: return "RestrictPointer"; + case Decoration::AliasedPointer: return "AliasedPointer"; + case Decoration::HitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV"; + case Decoration::HitObjectShaderRecordBufferEXT: return "HitObjectShaderRecordBufferEXT"; + case Decoration::BindlessSamplerNV: return "BindlessSamplerNV"; + case Decoration::BindlessImageNV: return "BindlessImageNV"; + case Decoration::BoundSamplerNV: return "BoundSamplerNV"; + case Decoration::BoundImageNV: return "BoundImageNV"; + case Decoration::SIMTCallINTEL: return "SIMTCallINTEL"; + case Decoration::ReferencedIndirectlyINTEL: return "ReferencedIndirectlyINTEL"; + case Decoration::ClobberINTEL: return "ClobberINTEL"; + case Decoration::SideEffectsINTEL: return "SideEffectsINTEL"; + case Decoration::VectorComputeVariableINTEL: return "VectorComputeVariableINTEL"; + case Decoration::FuncParamIOKindINTEL: return "FuncParamIOKindINTEL"; + case Decoration::VectorComputeFunctionINTEL: return "VectorComputeFunctionINTEL"; + case Decoration::StackCallINTEL: return "StackCallINTEL"; + case Decoration::GlobalVariableOffsetINTEL: return "GlobalVariableOffsetINTEL"; + case Decoration::CounterBuffer: return "CounterBuffer"; + case Decoration::HlslSemanticGOOGLE: return "HlslSemanticGOOGLE"; + case Decoration::UserTypeGOOGLE: return "UserTypeGOOGLE"; + case Decoration::FunctionRoundingModeINTEL: return "FunctionRoundingModeINTEL"; + case Decoration::FunctionDenormModeINTEL: return "FunctionDenormModeINTEL"; + case Decoration::RegisterINTEL: return "RegisterINTEL"; + case Decoration::MemoryINTEL: return "MemoryINTEL"; + case Decoration::NumbanksINTEL: return "NumbanksINTEL"; + case Decoration::BankwidthINTEL: return "BankwidthINTEL"; + case Decoration::MaxPrivateCopiesINTEL: return "MaxPrivateCopiesINTEL"; + case Decoration::SinglepumpINTEL: return "SinglepumpINTEL"; + case Decoration::DoublepumpINTEL: return "DoublepumpINTEL"; + case Decoration::MaxReplicatesINTEL: return "MaxReplicatesINTEL"; + case Decoration::SimpleDualPortINTEL: return "SimpleDualPortINTEL"; + case Decoration::MergeINTEL: return "MergeINTEL"; + case Decoration::BankBitsINTEL: return "BankBitsINTEL"; + case Decoration::ForcePow2DepthINTEL: return "ForcePow2DepthINTEL"; + case Decoration::StridesizeINTEL: return "StridesizeINTEL"; + case Decoration::WordsizeINTEL: return "WordsizeINTEL"; + case Decoration::TrueDualPortINTEL: return "TrueDualPortINTEL"; + case Decoration::BurstCoalesceINTEL: return "BurstCoalesceINTEL"; + case Decoration::CacheSizeINTEL: return "CacheSizeINTEL"; + case Decoration::DontStaticallyCoalesceINTEL: return "DontStaticallyCoalesceINTEL"; + case Decoration::PrefetchINTEL: return "PrefetchINTEL"; + case Decoration::StallEnableINTEL: return "StallEnableINTEL"; + case Decoration::FuseLoopsInFunctionINTEL: return "FuseLoopsInFunctionINTEL"; + case Decoration::MathOpDSPModeINTEL: return "MathOpDSPModeINTEL"; + case Decoration::AliasScopeINTEL: return "AliasScopeINTEL"; + case Decoration::NoAliasINTEL: return "NoAliasINTEL"; + case Decoration::InitiationIntervalINTEL: return "InitiationIntervalINTEL"; + case Decoration::MaxConcurrencyINTEL: return "MaxConcurrencyINTEL"; + case Decoration::PipelineEnableINTEL: return "PipelineEnableINTEL"; + case Decoration::BufferLocationINTEL: return "BufferLocationINTEL"; + case Decoration::IOPipeStorageINTEL: return "IOPipeStorageINTEL"; + case Decoration::FunctionFloatingPointModeINTEL: return "FunctionFloatingPointModeINTEL"; + case Decoration::SingleElementVectorINTEL: return "SingleElementVectorINTEL"; + case Decoration::VectorComputeCallableFunctionINTEL: return "VectorComputeCallableFunctionINTEL"; + case Decoration::MediaBlockIOINTEL: return "MediaBlockIOINTEL"; + case Decoration::StallFreeINTEL: return "StallFreeINTEL"; + case Decoration::FPMaxErrorDecorationINTEL: return "FPMaxErrorDecorationINTEL"; + case Decoration::LatencyControlLabelINTEL: return "LatencyControlLabelINTEL"; + case Decoration::LatencyControlConstraintINTEL: return "LatencyControlConstraintINTEL"; + case Decoration::ConduitKernelArgumentINTEL: return "ConduitKernelArgumentINTEL"; + case Decoration::RegisterMapKernelArgumentINTEL: return "RegisterMapKernelArgumentINTEL"; + case Decoration::MMHostInterfaceAddressWidthINTEL: return "MMHostInterfaceAddressWidthINTEL"; + case Decoration::MMHostInterfaceDataWidthINTEL: return "MMHostInterfaceDataWidthINTEL"; + case Decoration::MMHostInterfaceLatencyINTEL: return "MMHostInterfaceLatencyINTEL"; + case Decoration::MMHostInterfaceReadWriteModeINTEL: return "MMHostInterfaceReadWriteModeINTEL"; + case Decoration::MMHostInterfaceMaxBurstINTEL: return "MMHostInterfaceMaxBurstINTEL"; + case Decoration::MMHostInterfaceWaitRequestINTEL: return "MMHostInterfaceWaitRequestINTEL"; + case Decoration::StableKernelArgumentINTEL: return "StableKernelArgumentINTEL"; + case Decoration::HostAccessINTEL: return "HostAccessINTEL"; + case Decoration::InitModeINTEL: return "InitModeINTEL"; + case Decoration::ImplementInRegisterMapINTEL: return "ImplementInRegisterMapINTEL"; + case Decoration::CacheControlLoadINTEL: return "CacheControlLoadINTEL"; + case Decoration::CacheControlStoreINTEL: return "CacheControlStoreINTEL"; + default: return "Unknown"; + } +} + +inline const char* BuiltInToString(BuiltIn value) { + switch (value) { + case BuiltIn::Position: return "Position"; + case BuiltIn::PointSize: return "PointSize"; + case BuiltIn::ClipDistance: return "ClipDistance"; + case BuiltIn::CullDistance: return "CullDistance"; + case BuiltIn::VertexId: return "VertexId"; + case BuiltIn::InstanceId: return "InstanceId"; + case BuiltIn::PrimitiveId: return "PrimitiveId"; + case BuiltIn::InvocationId: return "InvocationId"; + case BuiltIn::Layer: return "Layer"; + case BuiltIn::ViewportIndex: return "ViewportIndex"; + case BuiltIn::TessLevelOuter: return "TessLevelOuter"; + case BuiltIn::TessLevelInner: return "TessLevelInner"; + case BuiltIn::TessCoord: return "TessCoord"; + case BuiltIn::PatchVertices: return "PatchVertices"; + case BuiltIn::FragCoord: return "FragCoord"; + case BuiltIn::PointCoord: return "PointCoord"; + case BuiltIn::FrontFacing: return "FrontFacing"; + case BuiltIn::SampleId: return "SampleId"; + case BuiltIn::SamplePosition: return "SamplePosition"; + case BuiltIn::SampleMask: return "SampleMask"; + case BuiltIn::FragDepth: return "FragDepth"; + case BuiltIn::HelperInvocation: return "HelperInvocation"; + case BuiltIn::NumWorkgroups: return "NumWorkgroups"; + case BuiltIn::WorkgroupSize: return "WorkgroupSize"; + case BuiltIn::WorkgroupId: return "WorkgroupId"; + case BuiltIn::LocalInvocationId: return "LocalInvocationId"; + case BuiltIn::GlobalInvocationId: return "GlobalInvocationId"; + case BuiltIn::LocalInvocationIndex: return "LocalInvocationIndex"; + case BuiltIn::WorkDim: return "WorkDim"; + case BuiltIn::GlobalSize: return "GlobalSize"; + case BuiltIn::EnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize"; + case BuiltIn::GlobalOffset: return "GlobalOffset"; + case BuiltIn::GlobalLinearId: return "GlobalLinearId"; + case BuiltIn::SubgroupSize: return "SubgroupSize"; + case BuiltIn::SubgroupMaxSize: return "SubgroupMaxSize"; + case BuiltIn::NumSubgroups: return "NumSubgroups"; + case BuiltIn::NumEnqueuedSubgroups: return "NumEnqueuedSubgroups"; + case BuiltIn::SubgroupId: return "SubgroupId"; + case BuiltIn::SubgroupLocalInvocationId: return "SubgroupLocalInvocationId"; + case BuiltIn::VertexIndex: return "VertexIndex"; + case BuiltIn::InstanceIndex: return "InstanceIndex"; + case BuiltIn::CoreIDARM: return "CoreIDARM"; + case BuiltIn::CoreCountARM: return "CoreCountARM"; + case BuiltIn::CoreMaxIDARM: return "CoreMaxIDARM"; + case BuiltIn::WarpIDARM: return "WarpIDARM"; + case BuiltIn::WarpMaxIDARM: return "WarpMaxIDARM"; + case BuiltIn::SubgroupEqMask: return "SubgroupEqMask"; + case BuiltIn::SubgroupGeMask: return "SubgroupGeMask"; + case BuiltIn::SubgroupGtMask: return "SubgroupGtMask"; + case BuiltIn::SubgroupLeMask: return "SubgroupLeMask"; + case BuiltIn::SubgroupLtMask: return "SubgroupLtMask"; + case BuiltIn::BaseVertex: return "BaseVertex"; + case BuiltIn::BaseInstance: return "BaseInstance"; + case BuiltIn::DrawIndex: return "DrawIndex"; + case BuiltIn::PrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR"; + case BuiltIn::DeviceIndex: return "DeviceIndex"; + case BuiltIn::ViewIndex: return "ViewIndex"; + case BuiltIn::ShadingRateKHR: return "ShadingRateKHR"; + case BuiltIn::TileOffsetQCOM: return "TileOffsetQCOM"; + case BuiltIn::TileDimensionQCOM: return "TileDimensionQCOM"; + case BuiltIn::TileApronSizeQCOM: return "TileApronSizeQCOM"; + case BuiltIn::BaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD"; + case BuiltIn::BaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD"; + case BuiltIn::BaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD"; + case BuiltIn::BaryCoordSmoothAMD: return "BaryCoordSmoothAMD"; + case BuiltIn::BaryCoordSmoothCentroidAMD: return "BaryCoordSmoothCentroidAMD"; + case BuiltIn::BaryCoordSmoothSampleAMD: return "BaryCoordSmoothSampleAMD"; + case BuiltIn::BaryCoordPullModelAMD: return "BaryCoordPullModelAMD"; + case BuiltIn::FragStencilRefEXT: return "FragStencilRefEXT"; + case BuiltIn::RemainingRecursionLevelsAMDX: return "RemainingRecursionLevelsAMDX"; + case BuiltIn::ShaderIndexAMDX: return "ShaderIndexAMDX"; + case BuiltIn::ViewportMaskNV: return "ViewportMaskNV"; + case BuiltIn::SecondaryPositionNV: return "SecondaryPositionNV"; + case BuiltIn::SecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case BuiltIn::PositionPerViewNV: return "PositionPerViewNV"; + case BuiltIn::ViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case BuiltIn::FullyCoveredEXT: return "FullyCoveredEXT"; + case BuiltIn::TaskCountNV: return "TaskCountNV"; + case BuiltIn::PrimitiveCountNV: return "PrimitiveCountNV"; + case BuiltIn::PrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case BuiltIn::ClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case BuiltIn::CullDistancePerViewNV: return "CullDistancePerViewNV"; + case BuiltIn::LayerPerViewNV: return "LayerPerViewNV"; + case BuiltIn::MeshViewCountNV: return "MeshViewCountNV"; + case BuiltIn::MeshViewIndicesNV: return "MeshViewIndicesNV"; + case BuiltIn::BaryCoordKHR: return "BaryCoordKHR"; + case BuiltIn::BaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR"; + case BuiltIn::FragSizeEXT: return "FragSizeEXT"; + case BuiltIn::FragInvocationCountEXT: return "FragInvocationCountEXT"; + case BuiltIn::PrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT"; + case BuiltIn::PrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT"; + case BuiltIn::PrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT"; + case BuiltIn::CullPrimitiveEXT: return "CullPrimitiveEXT"; + case BuiltIn::LaunchIdKHR: return "LaunchIdKHR"; + case BuiltIn::LaunchSizeKHR: return "LaunchSizeKHR"; + case BuiltIn::WorldRayOriginKHR: return "WorldRayOriginKHR"; + case BuiltIn::WorldRayDirectionKHR: return "WorldRayDirectionKHR"; + case BuiltIn::ObjectRayOriginKHR: return "ObjectRayOriginKHR"; + case BuiltIn::ObjectRayDirectionKHR: return "ObjectRayDirectionKHR"; + case BuiltIn::RayTminKHR: return "RayTminKHR"; + case BuiltIn::RayTmaxKHR: return "RayTmaxKHR"; + case BuiltIn::InstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; + case BuiltIn::ObjectToWorldKHR: return "ObjectToWorldKHR"; + case BuiltIn::WorldToObjectKHR: return "WorldToObjectKHR"; + case BuiltIn::HitTNV: return "HitTNV"; + case BuiltIn::HitKindKHR: return "HitKindKHR"; + case BuiltIn::CurrentRayTimeNV: return "CurrentRayTimeNV"; + case BuiltIn::HitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; + case BuiltIn::HitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV"; + case BuiltIn::HitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV"; + case BuiltIn::IncomingRayFlagsKHR: return "IncomingRayFlagsKHR"; + case BuiltIn::RayGeometryIndexKHR: return "RayGeometryIndexKHR"; + case BuiltIn::HitIsSphereNV: return "HitIsSphereNV"; + case BuiltIn::HitIsLSSNV: return "HitIsLSSNV"; + case BuiltIn::HitSpherePositionNV: return "HitSpherePositionNV"; + case BuiltIn::WarpsPerSMNV: return "WarpsPerSMNV"; + case BuiltIn::SMCountNV: return "SMCountNV"; + case BuiltIn::WarpIDNV: return "WarpIDNV"; + case BuiltIn::SMIDNV: return "SMIDNV"; + case BuiltIn::HitLSSPositionsNV: return "HitLSSPositionsNV"; + case BuiltIn::HitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case BuiltIn::HitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + case BuiltIn::HitSphereRadiusNV: return "HitSphereRadiusNV"; + case BuiltIn::HitLSSRadiiNV: return "HitLSSRadiiNV"; + case BuiltIn::ClusterIDNV: return "ClusterIDNV"; + case BuiltIn::CullMaskKHR: return "CullMaskKHR"; + default: return "Unknown"; + } +} + +inline const char* ScopeToString(Scope value) { + switch (value) { + case Scope::CrossDevice: return "CrossDevice"; + case Scope::Device: return "Device"; + case Scope::Workgroup: return "Workgroup"; + case Scope::Subgroup: return "Subgroup"; + case Scope::Invocation: return "Invocation"; + case Scope::QueueFamily: return "QueueFamily"; + case Scope::ShaderCallKHR: return "ShaderCallKHR"; + default: return "Unknown"; + } +} + +inline const char* GroupOperationToString(GroupOperation value) { + switch (value) { + case GroupOperation::Reduce: return "Reduce"; + case GroupOperation::InclusiveScan: return "InclusiveScan"; + case GroupOperation::ExclusiveScan: return "ExclusiveScan"; + case GroupOperation::ClusteredReduce: return "ClusteredReduce"; + case GroupOperation::PartitionedReduceNV: return "PartitionedReduceNV"; + case GroupOperation::PartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV"; + case GroupOperation::PartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV"; + default: return "Unknown"; + } +} + +inline const char* KernelEnqueueFlagsToString(KernelEnqueueFlags value) { + switch (value) { + case KernelEnqueueFlags::NoWait: return "NoWait"; + case KernelEnqueueFlags::WaitKernel: return "WaitKernel"; + case KernelEnqueueFlags::WaitWorkGroup: return "WaitWorkGroup"; + default: return "Unknown"; + } +} + +inline const char* CapabilityToString(Capability value) { + switch (value) { + case Capability::Matrix: return "Matrix"; + case Capability::Shader: return "Shader"; + case Capability::Geometry: return "Geometry"; + case Capability::Tessellation: return "Tessellation"; + case Capability::Addresses: return "Addresses"; + case Capability::Linkage: return "Linkage"; + case Capability::Kernel: return "Kernel"; + case Capability::Vector16: return "Vector16"; + case Capability::Float16Buffer: return "Float16Buffer"; + case Capability::Float16: return "Float16"; + case Capability::Float64: return "Float64"; + case Capability::Int64: return "Int64"; + case Capability::Int64Atomics: return "Int64Atomics"; + case Capability::ImageBasic: return "ImageBasic"; + case Capability::ImageReadWrite: return "ImageReadWrite"; + case Capability::ImageMipmap: return "ImageMipmap"; + case Capability::Pipes: return "Pipes"; + case Capability::Groups: return "Groups"; + case Capability::DeviceEnqueue: return "DeviceEnqueue"; + case Capability::LiteralSampler: return "LiteralSampler"; + case Capability::AtomicStorage: return "AtomicStorage"; + case Capability::Int16: return "Int16"; + case Capability::TessellationPointSize: return "TessellationPointSize"; + case Capability::GeometryPointSize: return "GeometryPointSize"; + case Capability::ImageGatherExtended: return "ImageGatherExtended"; + case Capability::StorageImageMultisample: return "StorageImageMultisample"; + case Capability::UniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing"; + case Capability::SampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing"; + case Capability::StorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing"; + case Capability::StorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing"; + case Capability::ClipDistance: return "ClipDistance"; + case Capability::CullDistance: return "CullDistance"; + case Capability::ImageCubeArray: return "ImageCubeArray"; + case Capability::SampleRateShading: return "SampleRateShading"; + case Capability::ImageRect: return "ImageRect"; + case Capability::SampledRect: return "SampledRect"; + case Capability::GenericPointer: return "GenericPointer"; + case Capability::Int8: return "Int8"; + case Capability::InputAttachment: return "InputAttachment"; + case Capability::SparseResidency: return "SparseResidency"; + case Capability::MinLod: return "MinLod"; + case Capability::Sampled1D: return "Sampled1D"; + case Capability::Image1D: return "Image1D"; + case Capability::SampledCubeArray: return "SampledCubeArray"; + case Capability::SampledBuffer: return "SampledBuffer"; + case Capability::ImageBuffer: return "ImageBuffer"; + case Capability::ImageMSArray: return "ImageMSArray"; + case Capability::StorageImageExtendedFormats: return "StorageImageExtendedFormats"; + case Capability::ImageQuery: return "ImageQuery"; + case Capability::DerivativeControl: return "DerivativeControl"; + case Capability::InterpolationFunction: return "InterpolationFunction"; + case Capability::TransformFeedback: return "TransformFeedback"; + case Capability::GeometryStreams: return "GeometryStreams"; + case Capability::StorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat"; + case Capability::StorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat"; + case Capability::MultiViewport: return "MultiViewport"; + case Capability::SubgroupDispatch: return "SubgroupDispatch"; + case Capability::NamedBarrier: return "NamedBarrier"; + case Capability::PipeStorage: return "PipeStorage"; + case Capability::GroupNonUniform: return "GroupNonUniform"; + case Capability::GroupNonUniformVote: return "GroupNonUniformVote"; + case Capability::GroupNonUniformArithmetic: return "GroupNonUniformArithmetic"; + case Capability::GroupNonUniformBallot: return "GroupNonUniformBallot"; + case Capability::GroupNonUniformShuffle: return "GroupNonUniformShuffle"; + case Capability::GroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative"; + case Capability::GroupNonUniformClustered: return "GroupNonUniformClustered"; + case Capability::GroupNonUniformQuad: return "GroupNonUniformQuad"; + case Capability::ShaderLayer: return "ShaderLayer"; + case Capability::ShaderViewportIndex: return "ShaderViewportIndex"; + case Capability::UniformDecoration: return "UniformDecoration"; + case Capability::CoreBuiltinsARM: return "CoreBuiltinsARM"; + case Capability::TileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; + case Capability::TileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; + case Capability::TileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case Capability::TensorsARM: return "TensorsARM"; + case Capability::CooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; + case Capability::Float8EXT: return "Float8EXT"; + case Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT"; + case Capability::FragmentShadingRateKHR: return "FragmentShadingRateKHR"; + case Capability::SubgroupBallotKHR: return "SubgroupBallotKHR"; + case Capability::DrawParameters: return "DrawParameters"; + case Capability::WorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR"; + case Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR"; + case Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR"; + case Capability::SubgroupVoteKHR: return "SubgroupVoteKHR"; + case Capability::StorageBuffer16BitAccess: return "StorageBuffer16BitAccess"; + case Capability::StorageUniform16: return "StorageUniform16"; + case Capability::StoragePushConstant16: return "StoragePushConstant16"; + case Capability::StorageInputOutput16: return "StorageInputOutput16"; + case Capability::DeviceGroup: return "DeviceGroup"; + case Capability::MultiView: return "MultiView"; + case Capability::VariablePointersStorageBuffer: return "VariablePointersStorageBuffer"; + case Capability::VariablePointers: return "VariablePointers"; + case Capability::AtomicStorageOps: return "AtomicStorageOps"; + case Capability::SampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; + case Capability::StorageBuffer8BitAccess: return "StorageBuffer8BitAccess"; + case Capability::UniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess"; + case Capability::StoragePushConstant8: return "StoragePushConstant8"; + case Capability::DenormPreserve: return "DenormPreserve"; + case Capability::DenormFlushToZero: return "DenormFlushToZero"; + case Capability::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case Capability::RoundingModeRTE: return "RoundingModeRTE"; + case Capability::RoundingModeRTZ: return "RoundingModeRTZ"; + case Capability::RayQueryProvisionalKHR: return "RayQueryProvisionalKHR"; + case Capability::RayQueryKHR: return "RayQueryKHR"; + case Capability::UntypedPointersKHR: return "UntypedPointersKHR"; + case Capability::RayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; + case Capability::RayTracingKHR: return "RayTracingKHR"; + case Capability::TextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; + case Capability::TextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; + case Capability::TextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + case Capability::TileShadingQCOM: return "TileShadingQCOM"; + case Capability::CooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM"; + case Capability::TextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; + case Capability::Float16ImageAMD: return "Float16ImageAMD"; + case Capability::ImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; + case Capability::FragmentMaskAMD: return "FragmentMaskAMD"; + case Capability::StencilExportEXT: return "StencilExportEXT"; + case Capability::ImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; + case Capability::Int64ImageEXT: return "Int64ImageEXT"; + case Capability::ShaderClockKHR: return "ShaderClockKHR"; + case Capability::ShaderEnqueueAMDX: return "ShaderEnqueueAMDX"; + case Capability::QuadControlKHR: return "QuadControlKHR"; + case Capability::BFloat16TypeKHR: return "BFloat16TypeKHR"; + case Capability::BFloat16DotProductKHR: return "BFloat16DotProductKHR"; + case Capability::BFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR"; + case Capability::SampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; + case Capability::GeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case Capability::ShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT"; + case Capability::ShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case Capability::ShaderStereoViewNV: return "ShaderStereoViewNV"; + case Capability::PerViewAttributesNV: return "PerViewAttributesNV"; + case Capability::FragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; + case Capability::MeshShadingNV: return "MeshShadingNV"; + case Capability::ImageFootprintNV: return "ImageFootprintNV"; + case Capability::MeshShadingEXT: return "MeshShadingEXT"; + case Capability::FragmentBarycentricKHR: return "FragmentBarycentricKHR"; + case Capability::ComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR"; + case Capability::FragmentDensityEXT: return "FragmentDensityEXT"; + case Capability::GroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; + case Capability::ShaderNonUniform: return "ShaderNonUniform"; + case Capability::RuntimeDescriptorArray: return "RuntimeDescriptorArray"; + case Capability::InputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing"; + case Capability::UniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing"; + case Capability::StorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing"; + case Capability::UniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing"; + case Capability::SampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing"; + case Capability::StorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing"; + case Capability::StorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing"; + case Capability::InputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing"; + case Capability::UniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing"; + case Capability::StorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing"; + case Capability::RayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case Capability::RayTracingNV: return "RayTracingNV"; + case Capability::RayTracingMotionBlurNV: return "RayTracingMotionBlurNV"; + case Capability::VulkanMemoryModel: return "VulkanMemoryModel"; + case Capability::VulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope"; + case Capability::PhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses"; + case Capability::ComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR"; + case Capability::RayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; + case Capability::CooperativeMatrixNV: return "CooperativeMatrixNV"; + case Capability::FragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT"; + case Capability::FragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT"; + case Capability::ShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV"; + case Capability::FragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT"; + case Capability::DemoteToHelperInvocation: return "DemoteToHelperInvocation"; + case Capability::DisplacementMicromapNV: return "DisplacementMicromapNV"; + case Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; + case Capability::ShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + case Capability::ShaderInvocationReorderEXT: return "ShaderInvocationReorderEXT"; + case Capability::BindlessTextureNV: return "BindlessTextureNV"; + case Capability::RayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; + case Capability::CooperativeVectorNV: return "CooperativeVectorNV"; + case Capability::AtomicFloat16VectorNV: return "AtomicFloat16VectorNV"; + case Capability::RayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV"; + case Capability::RawAccessChainsNV: return "RawAccessChainsNV"; + case Capability::RayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV"; + case Capability::RayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV"; + case Capability::LongVectorEXT: return "LongVectorEXT"; + case Capability::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT"; + case Capability::CooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV"; + case Capability::CooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV"; + case Capability::CooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV"; + case Capability::CooperativeMatrixTensorAddressingNV: return "CooperativeMatrixTensorAddressingNV"; + case Capability::CooperativeMatrixBlockLoadsNV: return "CooperativeMatrixBlockLoadsNV"; + case Capability::CooperativeVectorTrainingNV: return "CooperativeVectorTrainingNV"; + case Capability::RayTracingClusterAccelerationStructureNV: return "RayTracingClusterAccelerationStructureNV"; + case Capability::TensorAddressingNV: return "TensorAddressingNV"; + case Capability::SubgroupShuffleINTEL: return "SubgroupShuffleINTEL"; + case Capability::SubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL"; + case Capability::SubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL"; + case Capability::SubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL"; + case Capability::RoundToInfinityINTEL: return "RoundToInfinityINTEL"; + case Capability::FloatingPointModeINTEL: return "FloatingPointModeINTEL"; + case Capability::IntegerFunctions2INTEL: return "IntegerFunctions2INTEL"; + case Capability::FunctionPointersINTEL: return "FunctionPointersINTEL"; + case Capability::IndirectReferencesINTEL: return "IndirectReferencesINTEL"; + case Capability::AsmINTEL: return "AsmINTEL"; + case Capability::AtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT"; + case Capability::AtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT"; + case Capability::AtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT"; + case Capability::VectorComputeINTEL: return "VectorComputeINTEL"; + case Capability::VectorAnyINTEL: return "VectorAnyINTEL"; + case Capability::ExpectAssumeKHR: return "ExpectAssumeKHR"; + case Capability::SubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL"; + case Capability::SubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL"; + case Capability::SubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL"; + case Capability::VariableLengthArrayINTEL: return "VariableLengthArrayINTEL"; + case Capability::FunctionFloatControlINTEL: return "FunctionFloatControlINTEL"; + case Capability::FPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL"; + case Capability::FPFastMathModeINTEL: return "FPFastMathModeINTEL"; + case Capability::ArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL"; + case Capability::ArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL"; + case Capability::UnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL"; + case Capability::FPGALoopControlsINTEL: return "FPGALoopControlsINTEL"; + case Capability::KernelAttributesINTEL: return "KernelAttributesINTEL"; + case Capability::FPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL"; + case Capability::FPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL"; + case Capability::FPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL"; + case Capability::LoopFuseINTEL: return "LoopFuseINTEL"; + case Capability::FPGADSPControlINTEL: return "FPGADSPControlINTEL"; + case Capability::MemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL"; + case Capability::FPGAInvocationPipeliningAttributesINTEL: return "FPGAInvocationPipeliningAttributesINTEL"; + case Capability::FPGABufferLocationINTEL: return "FPGABufferLocationINTEL"; + case Capability::ArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL"; + case Capability::USMStorageClassesINTEL: return "USMStorageClassesINTEL"; + case Capability::RuntimeAlignedAttributeINTEL: return "RuntimeAlignedAttributeINTEL"; + case Capability::IOPipesINTEL: return "IOPipesINTEL"; + case Capability::BlockingPipesINTEL: return "BlockingPipesINTEL"; + case Capability::FPGARegINTEL: return "FPGARegINTEL"; + case Capability::DotProductInputAll: return "DotProductInputAll"; + case Capability::DotProductInput4x8Bit: return "DotProductInput4x8Bit"; + case Capability::DotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked"; + case Capability::DotProduct: return "DotProduct"; + case Capability::RayCullMaskKHR: return "RayCullMaskKHR"; + case Capability::CooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case Capability::ReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; + case Capability::BitInstructions: return "BitInstructions"; + case Capability::GroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; + case Capability::FloatControls2: return "FloatControls2"; + case Capability::AtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; + case Capability::AtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; + case Capability::LongCompositesINTEL: return "LongCompositesINTEL"; + case Capability::OptNoneEXT: return "OptNoneEXT"; + case Capability::AtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; + case Capability::DebugInfoModuleINTEL: return "DebugInfoModuleINTEL"; + case Capability::BFloat16ConversionINTEL: return "BFloat16ConversionINTEL"; + case Capability::SplitBarrierINTEL: return "SplitBarrierINTEL"; + case Capability::ArithmeticFenceEXT: return "ArithmeticFenceEXT"; + case Capability::FPGAClusterAttributesV2INTEL: return "FPGAClusterAttributesV2INTEL"; + case Capability::FPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL"; + case Capability::FPMaxErrorINTEL: return "FPMaxErrorINTEL"; + case Capability::FPGALatencyControlINTEL: return "FPGALatencyControlINTEL"; + case Capability::FPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL"; + case Capability::GlobalVariableHostAccessINTEL: return "GlobalVariableHostAccessINTEL"; + case Capability::GlobalVariableFPGADecorationsINTEL: return "GlobalVariableFPGADecorationsINTEL"; + case Capability::SubgroupBufferPrefetchINTEL: return "SubgroupBufferPrefetchINTEL"; + case Capability::Subgroup2DBlockIOINTEL: return "Subgroup2DBlockIOINTEL"; + case Capability::Subgroup2DBlockTransformINTEL: return "Subgroup2DBlockTransformINTEL"; + case Capability::Subgroup2DBlockTransposeINTEL: return "Subgroup2DBlockTransposeINTEL"; + case Capability::SubgroupMatrixMultiplyAccumulateINTEL: return "SubgroupMatrixMultiplyAccumulateINTEL"; + case Capability::GroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR"; + case Capability::MaskedGatherScatterINTEL: return "MaskedGatherScatterINTEL"; + case Capability::CacheControlsINTEL: return "CacheControlsINTEL"; + case Capability::RegisterLimitsINTEL: return "RegisterLimitsINTEL"; + default: return "Unknown"; + } +} + +inline const char* RayQueryIntersectionToString(RayQueryIntersection value) { + switch (value) { + case RayQueryIntersection::RayQueryCandidateIntersectionKHR: return "RayQueryCandidateIntersectionKHR"; + case RayQueryIntersection::RayQueryCommittedIntersectionKHR: return "RayQueryCommittedIntersectionKHR"; + default: return "Unknown"; + } +} + +inline const char* RayQueryCommittedIntersectionTypeToString(RayQueryCommittedIntersectionType value) { + switch (value) { + case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionNoneKHR: return "RayQueryCommittedIntersectionNoneKHR"; + case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionTriangleKHR: return "RayQueryCommittedIntersectionTriangleKHR"; + case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionGeneratedKHR: return "RayQueryCommittedIntersectionGeneratedKHR"; + default: return "Unknown"; + } +} + +inline const char* RayQueryCandidateIntersectionTypeToString(RayQueryCandidateIntersectionType value) { + switch (value) { + case RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionTriangleKHR: return "RayQueryCandidateIntersectionTriangleKHR"; + case RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionAABBKHR: return "RayQueryCandidateIntersectionAABBKHR"; + default: return "Unknown"; + } +} + +inline const char* FPDenormModeToString(FPDenormMode value) { + switch (value) { + case FPDenormMode::Preserve: return "Preserve"; + case FPDenormMode::FlushToZero: return "FlushToZero"; + default: return "Unknown"; + } +} + +inline const char* FPOperationModeToString(FPOperationMode value) { + switch (value) { + case FPOperationMode::IEEE: return "IEEE"; + case FPOperationMode::ALT: return "ALT"; + default: return "Unknown"; + } +} + +inline const char* QuantizationModesToString(QuantizationModes value) { + switch (value) { + case QuantizationModes::TRN: return "TRN"; + case QuantizationModes::TRN_ZERO: return "TRN_ZERO"; + case QuantizationModes::RND: return "RND"; + case QuantizationModes::RND_ZERO: return "RND_ZERO"; + case QuantizationModes::RND_INF: return "RND_INF"; + case QuantizationModes::RND_MIN_INF: return "RND_MIN_INF"; + case QuantizationModes::RND_CONV: return "RND_CONV"; + case QuantizationModes::RND_CONV_ODD: return "RND_CONV_ODD"; + default: return "Unknown"; + } +} + +inline const char* OverflowModesToString(OverflowModes value) { + switch (value) { + case OverflowModes::WRAP: return "WRAP"; + case OverflowModes::SAT: return "SAT"; + case OverflowModes::SAT_ZERO: return "SAT_ZERO"; + case OverflowModes::SAT_SYM: return "SAT_SYM"; + default: return "Unknown"; + } +} + +inline const char* PackedVectorFormatToString(PackedVectorFormat value) { + switch (value) { + case PackedVectorFormat::PackedVectorFormat4x8Bit: return "PackedVectorFormat4x8Bit"; + default: return "Unknown"; + } +} + +inline const char* CooperativeMatrixLayoutToString(CooperativeMatrixLayout value) { + switch (value) { + case CooperativeMatrixLayout::RowMajorKHR: return "RowMajorKHR"; + case CooperativeMatrixLayout::ColumnMajorKHR: return "ColumnMajorKHR"; + case CooperativeMatrixLayout::RowBlockedInterleavedARM: return "RowBlockedInterleavedARM"; + case CooperativeMatrixLayout::ColumnBlockedInterleavedARM: return "ColumnBlockedInterleavedARM"; + default: return "Unknown"; + } +} + +inline const char* CooperativeMatrixUseToString(CooperativeMatrixUse value) { + switch (value) { + case CooperativeMatrixUse::MatrixAKHR: return "MatrixAKHR"; + case CooperativeMatrixUse::MatrixBKHR: return "MatrixBKHR"; + case CooperativeMatrixUse::MatrixAccumulatorKHR: return "MatrixAccumulatorKHR"; + default: return "Unknown"; + } +} + +inline const char* TensorClampModeToString(TensorClampMode value) { + switch (value) { + case TensorClampMode::Undefined: return "Undefined"; + case TensorClampMode::Constant: return "Constant"; + case TensorClampMode::ClampToEdge: return "ClampToEdge"; + case TensorClampMode::Repeat: return "Repeat"; + case TensorClampMode::RepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* InitializationModeQualifierToString(InitializationModeQualifier value) { + switch (value) { + case InitializationModeQualifier::InitOnDeviceReprogramINTEL: return "InitOnDeviceReprogramINTEL"; + case InitializationModeQualifier::InitOnDeviceResetINTEL: return "InitOnDeviceResetINTEL"; + default: return "Unknown"; + } +} + +inline const char* HostAccessQualifierToString(HostAccessQualifier value) { + switch (value) { + case HostAccessQualifier::NoneINTEL: return "NoneINTEL"; + case HostAccessQualifier::ReadINTEL: return "ReadINTEL"; + case HostAccessQualifier::WriteINTEL: return "WriteINTEL"; + case HostAccessQualifier::ReadWriteINTEL: return "ReadWriteINTEL"; + default: return "Unknown"; + } +} + +inline const char* LoadCacheControlToString(LoadCacheControl value) { + switch (value) { + case LoadCacheControl::UncachedINTEL: return "UncachedINTEL"; + case LoadCacheControl::CachedINTEL: return "CachedINTEL"; + case LoadCacheControl::StreamingINTEL: return "StreamingINTEL"; + case LoadCacheControl::InvalidateAfterReadINTEL: return "InvalidateAfterReadINTEL"; + case LoadCacheControl::ConstCachedINTEL: return "ConstCachedINTEL"; + default: return "Unknown"; + } +} + +inline const char* StoreCacheControlToString(StoreCacheControl value) { + switch (value) { + case StoreCacheControl::UncachedINTEL: return "UncachedINTEL"; + case StoreCacheControl::WriteThroughINTEL: return "WriteThroughINTEL"; + case StoreCacheControl::WriteBackINTEL: return "WriteBackINTEL"; + case StoreCacheControl::StreamingINTEL: return "StreamingINTEL"; + default: return "Unknown"; + } +} + +inline const char* NamedMaximumNumberOfRegistersToString(NamedMaximumNumberOfRegisters value) { + switch (value) { + case NamedMaximumNumberOfRegisters::AutoINTEL: return "AutoINTEL"; + default: return "Unknown"; + } +} + +inline const char* FPEncodingToString(FPEncoding value) { + switch (value) { + case FPEncoding::BFloat16KHR: return "BFloat16KHR"; + case FPEncoding::Float8E4M3EXT: return "Float8E4M3EXT"; + case FPEncoding::Float8E5M2EXT: return "Float8E5M2EXT"; + default: return "Unknown"; + } +} + +inline const char* CooperativeVectorMatrixLayoutToString(CooperativeVectorMatrixLayout value) { + switch (value) { + case CooperativeVectorMatrixLayout::RowMajorNV: return "RowMajorNV"; + case CooperativeVectorMatrixLayout::ColumnMajorNV: return "ColumnMajorNV"; + case CooperativeVectorMatrixLayout::InferencingOptimalNV: return "InferencingOptimalNV"; + case CooperativeVectorMatrixLayout::TrainingOptimalNV: return "TrainingOptimalNV"; + default: return "Unknown"; + } +} + +inline const char* ComponentTypeToString(ComponentType value) { + switch (value) { + case ComponentType::Float16NV: return "Float16NV"; + case ComponentType::Float32NV: return "Float32NV"; + case ComponentType::Float64NV: return "Float64NV"; + case ComponentType::SignedInt8NV: return "SignedInt8NV"; + case ComponentType::SignedInt16NV: return "SignedInt16NV"; + case ComponentType::SignedInt32NV: return "SignedInt32NV"; + case ComponentType::SignedInt64NV: return "SignedInt64NV"; + case ComponentType::UnsignedInt8NV: return "UnsignedInt8NV"; + case ComponentType::UnsignedInt16NV: return "UnsignedInt16NV"; + case ComponentType::UnsignedInt32NV: return "UnsignedInt32NV"; + case ComponentType::UnsignedInt64NV: return "UnsignedInt64NV"; + case ComponentType::SignedInt8PackedNV: return "SignedInt8PackedNV"; + case ComponentType::UnsignedInt8PackedNV: return "UnsignedInt8PackedNV"; + case ComponentType::FloatE4M3NV: return "FloatE4M3NV"; + case ComponentType::FloatE5M2NV: return "FloatE5M2NV"; + default: return "Unknown"; + } +} + +inline const char* OpToString(Op value) { + switch (value) { + case Op::OpNop: return "OpNop"; + case Op::OpUndef: return "OpUndef"; + case Op::OpSourceContinued: return "OpSourceContinued"; + case Op::OpSource: return "OpSource"; + case Op::OpSourceExtension: return "OpSourceExtension"; + case Op::OpName: return "OpName"; + case Op::OpMemberName: return "OpMemberName"; + case Op::OpString: return "OpString"; + case Op::OpLine: return "OpLine"; + case Op::OpExtension: return "OpExtension"; + case Op::OpExtInstImport: return "OpExtInstImport"; + case Op::OpExtInst: return "OpExtInst"; + case Op::OpMemoryModel: return "OpMemoryModel"; + case Op::OpEntryPoint: return "OpEntryPoint"; + case Op::OpExecutionMode: return "OpExecutionMode"; + case Op::OpCapability: return "OpCapability"; + case Op::OpTypeVoid: return "OpTypeVoid"; + case Op::OpTypeBool: return "OpTypeBool"; + case Op::OpTypeInt: return "OpTypeInt"; + case Op::OpTypeFloat: return "OpTypeFloat"; + case Op::OpTypeVector: return "OpTypeVector"; + case Op::OpTypeMatrix: return "OpTypeMatrix"; + case Op::OpTypeImage: return "OpTypeImage"; + case Op::OpTypeSampler: return "OpTypeSampler"; + case Op::OpTypeSampledImage: return "OpTypeSampledImage"; + case Op::OpTypeArray: return "OpTypeArray"; + case Op::OpTypeRuntimeArray: return "OpTypeRuntimeArray"; + case Op::OpTypeStruct: return "OpTypeStruct"; + case Op::OpTypeOpaque: return "OpTypeOpaque"; + case Op::OpTypePointer: return "OpTypePointer"; + case Op::OpTypeFunction: return "OpTypeFunction"; + case Op::OpTypeEvent: return "OpTypeEvent"; + case Op::OpTypeDeviceEvent: return "OpTypeDeviceEvent"; + case Op::OpTypeReserveId: return "OpTypeReserveId"; + case Op::OpTypeQueue: return "OpTypeQueue"; + case Op::OpTypePipe: return "OpTypePipe"; + case Op::OpTypeForwardPointer: return "OpTypeForwardPointer"; + case Op::OpConstantTrue: return "OpConstantTrue"; + case Op::OpConstantFalse: return "OpConstantFalse"; + case Op::OpConstant: return "OpConstant"; + case Op::OpConstantComposite: return "OpConstantComposite"; + case Op::OpConstantSampler: return "OpConstantSampler"; + case Op::OpConstantNull: return "OpConstantNull"; + case Op::OpSpecConstantTrue: return "OpSpecConstantTrue"; + case Op::OpSpecConstantFalse: return "OpSpecConstantFalse"; + case Op::OpSpecConstant: return "OpSpecConstant"; + case Op::OpSpecConstantComposite: return "OpSpecConstantComposite"; + case Op::OpSpecConstantOp: return "OpSpecConstantOp"; + case Op::OpFunction: return "OpFunction"; + case Op::OpFunctionParameter: return "OpFunctionParameter"; + case Op::OpFunctionEnd: return "OpFunctionEnd"; + case Op::OpFunctionCall: return "OpFunctionCall"; + case Op::OpVariable: return "OpVariable"; + case Op::OpImageTexelPointer: return "OpImageTexelPointer"; + case Op::OpLoad: return "OpLoad"; + case Op::OpStore: return "OpStore"; + case Op::OpCopyMemory: return "OpCopyMemory"; + case Op::OpCopyMemorySized: return "OpCopyMemorySized"; + case Op::OpAccessChain: return "OpAccessChain"; + case Op::OpInBoundsAccessChain: return "OpInBoundsAccessChain"; + case Op::OpPtrAccessChain: return "OpPtrAccessChain"; + case Op::OpArrayLength: return "OpArrayLength"; + case Op::OpGenericPtrMemSemantics: return "OpGenericPtrMemSemantics"; + case Op::OpInBoundsPtrAccessChain: return "OpInBoundsPtrAccessChain"; + case Op::OpDecorate: return "OpDecorate"; + case Op::OpMemberDecorate: return "OpMemberDecorate"; + case Op::OpDecorationGroup: return "OpDecorationGroup"; + case Op::OpGroupDecorate: return "OpGroupDecorate"; + case Op::OpGroupMemberDecorate: return "OpGroupMemberDecorate"; + case Op::OpVectorExtractDynamic: return "OpVectorExtractDynamic"; + case Op::OpVectorInsertDynamic: return "OpVectorInsertDynamic"; + case Op::OpVectorShuffle: return "OpVectorShuffle"; + case Op::OpCompositeConstruct: return "OpCompositeConstruct"; + case Op::OpCompositeExtract: return "OpCompositeExtract"; + case Op::OpCompositeInsert: return "OpCompositeInsert"; + case Op::OpCopyObject: return "OpCopyObject"; + case Op::OpTranspose: return "OpTranspose"; + case Op::OpSampledImage: return "OpSampledImage"; + case Op::OpImageSampleImplicitLod: return "OpImageSampleImplicitLod"; + case Op::OpImageSampleExplicitLod: return "OpImageSampleExplicitLod"; + case Op::OpImageSampleDrefImplicitLod: return "OpImageSampleDrefImplicitLod"; + case Op::OpImageSampleDrefExplicitLod: return "OpImageSampleDrefExplicitLod"; + case Op::OpImageSampleProjImplicitLod: return "OpImageSampleProjImplicitLod"; + case Op::OpImageSampleProjExplicitLod: return "OpImageSampleProjExplicitLod"; + case Op::OpImageSampleProjDrefImplicitLod: return "OpImageSampleProjDrefImplicitLod"; + case Op::OpImageSampleProjDrefExplicitLod: return "OpImageSampleProjDrefExplicitLod"; + case Op::OpImageFetch: return "OpImageFetch"; + case Op::OpImageGather: return "OpImageGather"; + case Op::OpImageDrefGather: return "OpImageDrefGather"; + case Op::OpImageRead: return "OpImageRead"; + case Op::OpImageWrite: return "OpImageWrite"; + case Op::OpImage: return "OpImage"; + case Op::OpImageQueryFormat: return "OpImageQueryFormat"; + case Op::OpImageQueryOrder: return "OpImageQueryOrder"; + case Op::OpImageQuerySizeLod: return "OpImageQuerySizeLod"; + case Op::OpImageQuerySize: return "OpImageQuerySize"; + case Op::OpImageQueryLod: return "OpImageQueryLod"; + case Op::OpImageQueryLevels: return "OpImageQueryLevels"; + case Op::OpImageQuerySamples: return "OpImageQuerySamples"; + case Op::OpConvertFToU: return "OpConvertFToU"; + case Op::OpConvertFToS: return "OpConvertFToS"; + case Op::OpConvertSToF: return "OpConvertSToF"; + case Op::OpConvertUToF: return "OpConvertUToF"; + case Op::OpUConvert: return "OpUConvert"; + case Op::OpSConvert: return "OpSConvert"; + case Op::OpFConvert: return "OpFConvert"; + case Op::OpQuantizeToF16: return "OpQuantizeToF16"; + case Op::OpConvertPtrToU: return "OpConvertPtrToU"; + case Op::OpSatConvertSToU: return "OpSatConvertSToU"; + case Op::OpSatConvertUToS: return "OpSatConvertUToS"; + case Op::OpConvertUToPtr: return "OpConvertUToPtr"; + case Op::OpPtrCastToGeneric: return "OpPtrCastToGeneric"; + case Op::OpGenericCastToPtr: return "OpGenericCastToPtr"; + case Op::OpGenericCastToPtrExplicit: return "OpGenericCastToPtrExplicit"; + case Op::OpBitcast: return "OpBitcast"; + case Op::OpSNegate: return "OpSNegate"; + case Op::OpFNegate: return "OpFNegate"; + case Op::OpIAdd: return "OpIAdd"; + case Op::OpFAdd: return "OpFAdd"; + case Op::OpISub: return "OpISub"; + case Op::OpFSub: return "OpFSub"; + case Op::OpIMul: return "OpIMul"; + case Op::OpFMul: return "OpFMul"; + case Op::OpUDiv: return "OpUDiv"; + case Op::OpSDiv: return "OpSDiv"; + case Op::OpFDiv: return "OpFDiv"; + case Op::OpUMod: return "OpUMod"; + case Op::OpSRem: return "OpSRem"; + case Op::OpSMod: return "OpSMod"; + case Op::OpFRem: return "OpFRem"; + case Op::OpFMod: return "OpFMod"; + case Op::OpVectorTimesScalar: return "OpVectorTimesScalar"; + case Op::OpMatrixTimesScalar: return "OpMatrixTimesScalar"; + case Op::OpVectorTimesMatrix: return "OpVectorTimesMatrix"; + case Op::OpMatrixTimesVector: return "OpMatrixTimesVector"; + case Op::OpMatrixTimesMatrix: return "OpMatrixTimesMatrix"; + case Op::OpOuterProduct: return "OpOuterProduct"; + case Op::OpDot: return "OpDot"; + case Op::OpIAddCarry: return "OpIAddCarry"; + case Op::OpISubBorrow: return "OpISubBorrow"; + case Op::OpUMulExtended: return "OpUMulExtended"; + case Op::OpSMulExtended: return "OpSMulExtended"; + case Op::OpAny: return "OpAny"; + case Op::OpAll: return "OpAll"; + case Op::OpIsNan: return "OpIsNan"; + case Op::OpIsInf: return "OpIsInf"; + case Op::OpIsFinite: return "OpIsFinite"; + case Op::OpIsNormal: return "OpIsNormal"; + case Op::OpSignBitSet: return "OpSignBitSet"; + case Op::OpLessOrGreater: return "OpLessOrGreater"; + case Op::OpOrdered: return "OpOrdered"; + case Op::OpUnordered: return "OpUnordered"; + case Op::OpLogicalEqual: return "OpLogicalEqual"; + case Op::OpLogicalNotEqual: return "OpLogicalNotEqual"; + case Op::OpLogicalOr: return "OpLogicalOr"; + case Op::OpLogicalAnd: return "OpLogicalAnd"; + case Op::OpLogicalNot: return "OpLogicalNot"; + case Op::OpSelect: return "OpSelect"; + case Op::OpIEqual: return "OpIEqual"; + case Op::OpINotEqual: return "OpINotEqual"; + case Op::OpUGreaterThan: return "OpUGreaterThan"; + case Op::OpSGreaterThan: return "OpSGreaterThan"; + case Op::OpUGreaterThanEqual: return "OpUGreaterThanEqual"; + case Op::OpSGreaterThanEqual: return "OpSGreaterThanEqual"; + case Op::OpULessThan: return "OpULessThan"; + case Op::OpSLessThan: return "OpSLessThan"; + case Op::OpULessThanEqual: return "OpULessThanEqual"; + case Op::OpSLessThanEqual: return "OpSLessThanEqual"; + case Op::OpFOrdEqual: return "OpFOrdEqual"; + case Op::OpFUnordEqual: return "OpFUnordEqual"; + case Op::OpFOrdNotEqual: return "OpFOrdNotEqual"; + case Op::OpFUnordNotEqual: return "OpFUnordNotEqual"; + case Op::OpFOrdLessThan: return "OpFOrdLessThan"; + case Op::OpFUnordLessThan: return "OpFUnordLessThan"; + case Op::OpFOrdGreaterThan: return "OpFOrdGreaterThan"; + case Op::OpFUnordGreaterThan: return "OpFUnordGreaterThan"; + case Op::OpFOrdLessThanEqual: return "OpFOrdLessThanEqual"; + case Op::OpFUnordLessThanEqual: return "OpFUnordLessThanEqual"; + case Op::OpFOrdGreaterThanEqual: return "OpFOrdGreaterThanEqual"; + case Op::OpFUnordGreaterThanEqual: return "OpFUnordGreaterThanEqual"; + case Op::OpShiftRightLogical: return "OpShiftRightLogical"; + case Op::OpShiftRightArithmetic: return "OpShiftRightArithmetic"; + case Op::OpShiftLeftLogical: return "OpShiftLeftLogical"; + case Op::OpBitwiseOr: return "OpBitwiseOr"; + case Op::OpBitwiseXor: return "OpBitwiseXor"; + case Op::OpBitwiseAnd: return "OpBitwiseAnd"; + case Op::OpNot: return "OpNot"; + case Op::OpBitFieldInsert: return "OpBitFieldInsert"; + case Op::OpBitFieldSExtract: return "OpBitFieldSExtract"; + case Op::OpBitFieldUExtract: return "OpBitFieldUExtract"; + case Op::OpBitReverse: return "OpBitReverse"; + case Op::OpBitCount: return "OpBitCount"; + case Op::OpDPdx: return "OpDPdx"; + case Op::OpDPdy: return "OpDPdy"; + case Op::OpFwidth: return "OpFwidth"; + case Op::OpDPdxFine: return "OpDPdxFine"; + case Op::OpDPdyFine: return "OpDPdyFine"; + case Op::OpFwidthFine: return "OpFwidthFine"; + case Op::OpDPdxCoarse: return "OpDPdxCoarse"; + case Op::OpDPdyCoarse: return "OpDPdyCoarse"; + case Op::OpFwidthCoarse: return "OpFwidthCoarse"; + case Op::OpEmitVertex: return "OpEmitVertex"; + case Op::OpEndPrimitive: return "OpEndPrimitive"; + case Op::OpEmitStreamVertex: return "OpEmitStreamVertex"; + case Op::OpEndStreamPrimitive: return "OpEndStreamPrimitive"; + case Op::OpControlBarrier: return "OpControlBarrier"; + case Op::OpMemoryBarrier: return "OpMemoryBarrier"; + case Op::OpAtomicLoad: return "OpAtomicLoad"; + case Op::OpAtomicStore: return "OpAtomicStore"; + case Op::OpAtomicExchange: return "OpAtomicExchange"; + case Op::OpAtomicCompareExchange: return "OpAtomicCompareExchange"; + case Op::OpAtomicCompareExchangeWeak: return "OpAtomicCompareExchangeWeak"; + case Op::OpAtomicIIncrement: return "OpAtomicIIncrement"; + case Op::OpAtomicIDecrement: return "OpAtomicIDecrement"; + case Op::OpAtomicIAdd: return "OpAtomicIAdd"; + case Op::OpAtomicISub: return "OpAtomicISub"; + case Op::OpAtomicSMin: return "OpAtomicSMin"; + case Op::OpAtomicUMin: return "OpAtomicUMin"; + case Op::OpAtomicSMax: return "OpAtomicSMax"; + case Op::OpAtomicUMax: return "OpAtomicUMax"; + case Op::OpAtomicAnd: return "OpAtomicAnd"; + case Op::OpAtomicOr: return "OpAtomicOr"; + case Op::OpAtomicXor: return "OpAtomicXor"; + case Op::OpPhi: return "OpPhi"; + case Op::OpLoopMerge: return "OpLoopMerge"; + case Op::OpSelectionMerge: return "OpSelectionMerge"; + case Op::OpLabel: return "OpLabel"; + case Op::OpBranch: return "OpBranch"; + case Op::OpBranchConditional: return "OpBranchConditional"; + case Op::OpSwitch: return "OpSwitch"; + case Op::OpKill: return "OpKill"; + case Op::OpReturn: return "OpReturn"; + case Op::OpReturnValue: return "OpReturnValue"; + case Op::OpUnreachable: return "OpUnreachable"; + case Op::OpLifetimeStart: return "OpLifetimeStart"; + case Op::OpLifetimeStop: return "OpLifetimeStop"; + case Op::OpGroupAsyncCopy: return "OpGroupAsyncCopy"; + case Op::OpGroupWaitEvents: return "OpGroupWaitEvents"; + case Op::OpGroupAll: return "OpGroupAll"; + case Op::OpGroupAny: return "OpGroupAny"; + case Op::OpGroupBroadcast: return "OpGroupBroadcast"; + case Op::OpGroupIAdd: return "OpGroupIAdd"; + case Op::OpGroupFAdd: return "OpGroupFAdd"; + case Op::OpGroupFMin: return "OpGroupFMin"; + case Op::OpGroupUMin: return "OpGroupUMin"; + case Op::OpGroupSMin: return "OpGroupSMin"; + case Op::OpGroupFMax: return "OpGroupFMax"; + case Op::OpGroupUMax: return "OpGroupUMax"; + case Op::OpGroupSMax: return "OpGroupSMax"; + case Op::OpReadPipe: return "OpReadPipe"; + case Op::OpWritePipe: return "OpWritePipe"; + case Op::OpReservedReadPipe: return "OpReservedReadPipe"; + case Op::OpReservedWritePipe: return "OpReservedWritePipe"; + case Op::OpReserveReadPipePackets: return "OpReserveReadPipePackets"; + case Op::OpReserveWritePipePackets: return "OpReserveWritePipePackets"; + case Op::OpCommitReadPipe: return "OpCommitReadPipe"; + case Op::OpCommitWritePipe: return "OpCommitWritePipe"; + case Op::OpIsValidReserveId: return "OpIsValidReserveId"; + case Op::OpGetNumPipePackets: return "OpGetNumPipePackets"; + case Op::OpGetMaxPipePackets: return "OpGetMaxPipePackets"; + case Op::OpGroupReserveReadPipePackets: return "OpGroupReserveReadPipePackets"; + case Op::OpGroupReserveWritePipePackets: return "OpGroupReserveWritePipePackets"; + case Op::OpGroupCommitReadPipe: return "OpGroupCommitReadPipe"; + case Op::OpGroupCommitWritePipe: return "OpGroupCommitWritePipe"; + case Op::OpEnqueueMarker: return "OpEnqueueMarker"; + case Op::OpEnqueueKernel: return "OpEnqueueKernel"; + case Op::OpGetKernelNDrangeSubGroupCount: return "OpGetKernelNDrangeSubGroupCount"; + case Op::OpGetKernelNDrangeMaxSubGroupSize: return "OpGetKernelNDrangeMaxSubGroupSize"; + case Op::OpGetKernelWorkGroupSize: return "OpGetKernelWorkGroupSize"; + case Op::OpGetKernelPreferredWorkGroupSizeMultiple: return "OpGetKernelPreferredWorkGroupSizeMultiple"; + case Op::OpRetainEvent: return "OpRetainEvent"; + case Op::OpReleaseEvent: return "OpReleaseEvent"; + case Op::OpCreateUserEvent: return "OpCreateUserEvent"; + case Op::OpIsValidEvent: return "OpIsValidEvent"; + case Op::OpSetUserEventStatus: return "OpSetUserEventStatus"; + case Op::OpCaptureEventProfilingInfo: return "OpCaptureEventProfilingInfo"; + case Op::OpGetDefaultQueue: return "OpGetDefaultQueue"; + case Op::OpBuildNDRange: return "OpBuildNDRange"; + case Op::OpImageSparseSampleImplicitLod: return "OpImageSparseSampleImplicitLod"; + case Op::OpImageSparseSampleExplicitLod: return "OpImageSparseSampleExplicitLod"; + case Op::OpImageSparseSampleDrefImplicitLod: return "OpImageSparseSampleDrefImplicitLod"; + case Op::OpImageSparseSampleDrefExplicitLod: return "OpImageSparseSampleDrefExplicitLod"; + case Op::OpImageSparseSampleProjImplicitLod: return "OpImageSparseSampleProjImplicitLod"; + case Op::OpImageSparseSampleProjExplicitLod: return "OpImageSparseSampleProjExplicitLod"; + case Op::OpImageSparseSampleProjDrefImplicitLod: return "OpImageSparseSampleProjDrefImplicitLod"; + case Op::OpImageSparseSampleProjDrefExplicitLod: return "OpImageSparseSampleProjDrefExplicitLod"; + case Op::OpImageSparseFetch: return "OpImageSparseFetch"; + case Op::OpImageSparseGather: return "OpImageSparseGather"; + case Op::OpImageSparseDrefGather: return "OpImageSparseDrefGather"; + case Op::OpImageSparseTexelsResident: return "OpImageSparseTexelsResident"; + case Op::OpNoLine: return "OpNoLine"; + case Op::OpAtomicFlagTestAndSet: return "OpAtomicFlagTestAndSet"; + case Op::OpAtomicFlagClear: return "OpAtomicFlagClear"; + case Op::OpImageSparseRead: return "OpImageSparseRead"; + case Op::OpSizeOf: return "OpSizeOf"; + case Op::OpTypePipeStorage: return "OpTypePipeStorage"; + case Op::OpConstantPipeStorage: return "OpConstantPipeStorage"; + case Op::OpCreatePipeFromPipeStorage: return "OpCreatePipeFromPipeStorage"; + case Op::OpGetKernelLocalSizeForSubgroupCount: return "OpGetKernelLocalSizeForSubgroupCount"; + case Op::OpGetKernelMaxNumSubgroups: return "OpGetKernelMaxNumSubgroups"; + case Op::OpTypeNamedBarrier: return "OpTypeNamedBarrier"; + case Op::OpNamedBarrierInitialize: return "OpNamedBarrierInitialize"; + case Op::OpMemoryNamedBarrier: return "OpMemoryNamedBarrier"; + case Op::OpModuleProcessed: return "OpModuleProcessed"; + case Op::OpExecutionModeId: return "OpExecutionModeId"; + case Op::OpDecorateId: return "OpDecorateId"; + case Op::OpGroupNonUniformElect: return "OpGroupNonUniformElect"; + case Op::OpGroupNonUniformAll: return "OpGroupNonUniformAll"; + case Op::OpGroupNonUniformAny: return "OpGroupNonUniformAny"; + case Op::OpGroupNonUniformAllEqual: return "OpGroupNonUniformAllEqual"; + case Op::OpGroupNonUniformBroadcast: return "OpGroupNonUniformBroadcast"; + case Op::OpGroupNonUniformBroadcastFirst: return "OpGroupNonUniformBroadcastFirst"; + case Op::OpGroupNonUniformBallot: return "OpGroupNonUniformBallot"; + case Op::OpGroupNonUniformInverseBallot: return "OpGroupNonUniformInverseBallot"; + case Op::OpGroupNonUniformBallotBitExtract: return "OpGroupNonUniformBallotBitExtract"; + case Op::OpGroupNonUniformBallotBitCount: return "OpGroupNonUniformBallotBitCount"; + case Op::OpGroupNonUniformBallotFindLSB: return "OpGroupNonUniformBallotFindLSB"; + case Op::OpGroupNonUniformBallotFindMSB: return "OpGroupNonUniformBallotFindMSB"; + case Op::OpGroupNonUniformShuffle: return "OpGroupNonUniformShuffle"; + case Op::OpGroupNonUniformShuffleXor: return "OpGroupNonUniformShuffleXor"; + case Op::OpGroupNonUniformShuffleUp: return "OpGroupNonUniformShuffleUp"; + case Op::OpGroupNonUniformShuffleDown: return "OpGroupNonUniformShuffleDown"; + case Op::OpGroupNonUniformIAdd: return "OpGroupNonUniformIAdd"; + case Op::OpGroupNonUniformFAdd: return "OpGroupNonUniformFAdd"; + case Op::OpGroupNonUniformIMul: return "OpGroupNonUniformIMul"; + case Op::OpGroupNonUniformFMul: return "OpGroupNonUniformFMul"; + case Op::OpGroupNonUniformSMin: return "OpGroupNonUniformSMin"; + case Op::OpGroupNonUniformUMin: return "OpGroupNonUniformUMin"; + case Op::OpGroupNonUniformFMin: return "OpGroupNonUniformFMin"; + case Op::OpGroupNonUniformSMax: return "OpGroupNonUniformSMax"; + case Op::OpGroupNonUniformUMax: return "OpGroupNonUniformUMax"; + case Op::OpGroupNonUniformFMax: return "OpGroupNonUniformFMax"; + case Op::OpGroupNonUniformBitwiseAnd: return "OpGroupNonUniformBitwiseAnd"; + case Op::OpGroupNonUniformBitwiseOr: return "OpGroupNonUniformBitwiseOr"; + case Op::OpGroupNonUniformBitwiseXor: return "OpGroupNonUniformBitwiseXor"; + case Op::OpGroupNonUniformLogicalAnd: return "OpGroupNonUniformLogicalAnd"; + case Op::OpGroupNonUniformLogicalOr: return "OpGroupNonUniformLogicalOr"; + case Op::OpGroupNonUniformLogicalXor: return "OpGroupNonUniformLogicalXor"; + case Op::OpGroupNonUniformQuadBroadcast: return "OpGroupNonUniformQuadBroadcast"; + case Op::OpGroupNonUniformQuadSwap: return "OpGroupNonUniformQuadSwap"; + case Op::OpCopyLogical: return "OpCopyLogical"; + case Op::OpPtrEqual: return "OpPtrEqual"; + case Op::OpPtrNotEqual: return "OpPtrNotEqual"; + case Op::OpPtrDiff: return "OpPtrDiff"; + case Op::OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; + case Op::OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; + case Op::OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + case Op::OpTypeTensorARM: return "OpTypeTensorARM"; + case Op::OpTensorReadARM: return "OpTensorReadARM"; + case Op::OpTensorWriteARM: return "OpTensorWriteARM"; + case Op::OpTensorQuerySizeARM: return "OpTensorQuerySizeARM"; + case Op::OpTerminateInvocation: return "OpTerminateInvocation"; + case Op::OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR"; + case Op::OpUntypedVariableKHR: return "OpUntypedVariableKHR"; + case Op::OpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR"; + case Op::OpUntypedInBoundsAccessChainKHR: return "OpUntypedInBoundsAccessChainKHR"; + case Op::OpSubgroupBallotKHR: return "OpSubgroupBallotKHR"; + case Op::OpSubgroupFirstInvocationKHR: return "OpSubgroupFirstInvocationKHR"; + case Op::OpUntypedPtrAccessChainKHR: return "OpUntypedPtrAccessChainKHR"; + case Op::OpUntypedInBoundsPtrAccessChainKHR: return "OpUntypedInBoundsPtrAccessChainKHR"; + case Op::OpUntypedArrayLengthKHR: return "OpUntypedArrayLengthKHR"; + case Op::OpUntypedPrefetchKHR: return "OpUntypedPrefetchKHR"; + case Op::OpSubgroupAllKHR: return "OpSubgroupAllKHR"; + case Op::OpSubgroupAnyKHR: return "OpSubgroupAnyKHR"; + case Op::OpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR"; + case Op::OpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR"; + case Op::OpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR"; + case Op::OpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR"; + case Op::OpTraceRayKHR: return "OpTraceRayKHR"; + case Op::OpExecuteCallableKHR: return "OpExecuteCallableKHR"; + case Op::OpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR"; + case Op::OpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR"; + case Op::OpTerminateRayKHR: return "OpTerminateRayKHR"; + case Op::OpSDot: return "OpSDot"; + case Op::OpUDot: return "OpUDot"; + case Op::OpSUDot: return "OpSUDot"; + case Op::OpSDotAccSat: return "OpSDotAccSat"; + case Op::OpUDotAccSat: return "OpUDotAccSat"; + case Op::OpSUDotAccSat: return "OpSUDotAccSat"; + case Op::OpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR"; + case Op::OpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR"; + case Op::OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; + case Op::OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; + case Op::OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case Op::OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case Op::OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case Op::OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; + case Op::OpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; + case Op::OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; + case Op::OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; + case Op::OpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR"; + case Op::OpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR"; + case Op::OpRayQueryProceedKHR: return "OpRayQueryProceedKHR"; + case Op::OpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR"; + case Op::OpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM"; + case Op::OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; + case Op::OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; + case Op::OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; + case Op::OpBitCastArrayQCOM: return "OpBitCastArrayQCOM"; + case Op::OpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM"; + case Op::OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM"; + case Op::OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; + case Op::OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + case Op::OpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM"; + case Op::OpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM"; + case Op::OpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM"; + case Op::OpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD"; + case Op::OpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD"; + case Op::OpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD"; + case Op::OpGroupUMinNonUniformAMD: return "OpGroupUMinNonUniformAMD"; + case Op::OpGroupSMinNonUniformAMD: return "OpGroupSMinNonUniformAMD"; + case Op::OpGroupFMaxNonUniformAMD: return "OpGroupFMaxNonUniformAMD"; + case Op::OpGroupUMaxNonUniformAMD: return "OpGroupUMaxNonUniformAMD"; + case Op::OpGroupSMaxNonUniformAMD: return "OpGroupSMaxNonUniformAMD"; + case Op::OpFragmentMaskFetchAMD: return "OpFragmentMaskFetchAMD"; + case Op::OpFragmentFetchAMD: return "OpFragmentFetchAMD"; + case Op::OpReadClockKHR: return "OpReadClockKHR"; + case Op::OpAllocateNodePayloadsAMDX: return "OpAllocateNodePayloadsAMDX"; + case Op::OpEnqueueNodePayloadsAMDX: return "OpEnqueueNodePayloadsAMDX"; + case Op::OpTypeNodePayloadArrayAMDX: return "OpTypeNodePayloadArrayAMDX"; + case Op::OpFinishWritingNodePayloadAMDX: return "OpFinishWritingNodePayloadAMDX"; + case Op::OpNodePayloadArrayLengthAMDX: return "OpNodePayloadArrayLengthAMDX"; + case Op::OpIsNodePayloadValidAMDX: return "OpIsNodePayloadValidAMDX"; + case Op::OpConstantStringAMDX: return "OpConstantStringAMDX"; + case Op::OpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX"; + case Op::OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; + case Op::OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; + case Op::OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV"; + case Op::OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV"; + case Op::OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV"; + case Op::OpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV"; + case Op::OpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV"; + case Op::OpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV"; + case Op::OpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV"; + case Op::OpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV"; + case Op::OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case Op::OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; + case Op::OpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV"; + case Op::OpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV"; + case Op::OpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV"; + case Op::OpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV"; + case Op::OpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV"; + case Op::OpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV"; + case Op::OpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV"; + case Op::OpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV"; + case Op::OpHitObjectGetHitKindNV: return "OpHitObjectGetHitKindNV"; + case Op::OpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV"; + case Op::OpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV"; + case Op::OpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV"; + case Op::OpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV"; + case Op::OpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV"; + case Op::OpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV"; + case Op::OpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV"; + case Op::OpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV"; + case Op::OpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV"; + case Op::OpHitObjectIsHitNV: return "OpHitObjectIsHitNV"; + case Op::OpHitObjectIsMissNV: return "OpHitObjectIsMissNV"; + case Op::OpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV"; + case Op::OpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV"; + case Op::OpTypeHitObjectNV: return "OpTypeHitObjectNV"; + case Op::OpImageSampleFootprintNV: return "OpImageSampleFootprintNV"; + case Op::OpTypeCooperativeVectorNV: return "OpTypeCooperativeVectorNV"; + case Op::OpCooperativeVectorMatrixMulNV: return "OpCooperativeVectorMatrixMulNV"; + case Op::OpCooperativeVectorOuterProductAccumulateNV: return "OpCooperativeVectorOuterProductAccumulateNV"; + case Op::OpCooperativeVectorReduceSumAccumulateNV: return "OpCooperativeVectorReduceSumAccumulateNV"; + case Op::OpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV"; + case Op::OpCooperativeMatrixConvertNV: return "OpCooperativeMatrixConvertNV"; + case Op::OpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT"; + case Op::OpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT"; + case Op::OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; + case Op::OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV"; + case Op::OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV"; + case Op::OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; + case Op::OpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV"; + case Op::OpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV"; + case Op::OpHitObjectRecordFromQueryEXT: return "OpHitObjectRecordFromQueryEXT"; + case Op::OpHitObjectRecordMissEXT: return "OpHitObjectRecordMissEXT"; + case Op::OpHitObjectRecordMissMotionEXT: return "OpHitObjectRecordMissMotionEXT"; + case Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: return "OpHitObjectGetIntersectionTriangleVertexPositionsEXT"; + case Op::OpHitObjectGetRayFlagsEXT: return "OpHitObjectGetRayFlagsEXT"; + case Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: return "OpHitObjectSetShaderBindingTableRecordIndexEXT"; + case Op::OpHitObjectReorderExecuteShaderEXT: return "OpHitObjectReorderExecuteShaderEXT"; + case Op::OpHitObjectTraceReorderExecuteEXT: return "OpHitObjectTraceReorderExecuteEXT"; + case Op::OpHitObjectTraceMotionReorderExecuteEXT: return "OpHitObjectTraceMotionReorderExecuteEXT"; + case Op::OpTypeHitObjectEXT: return "OpTypeHitObjectEXT"; + case Op::OpReorderThreadWithHintEXT: return "OpReorderThreadWithHintEXT"; + case Op::OpReorderThreadWithHitObjectEXT: return "OpReorderThreadWithHitObjectEXT"; + case Op::OpHitObjectTraceRayEXT: return "OpHitObjectTraceRayEXT"; + case Op::OpHitObjectTraceRayMotionEXT: return "OpHitObjectTraceRayMotionEXT"; + case Op::OpHitObjectRecordEmptyEXT: return "OpHitObjectRecordEmptyEXT"; + case Op::OpHitObjectExecuteShaderEXT: return "OpHitObjectExecuteShaderEXT"; + case Op::OpHitObjectGetCurrentTimeEXT: return "OpHitObjectGetCurrentTimeEXT"; + case Op::OpHitObjectGetAttributesEXT: return "OpHitObjectGetAttributesEXT"; + case Op::OpHitObjectGetHitKindEXT: return "OpHitObjectGetHitKindEXT"; + case Op::OpHitObjectGetPrimitiveIndexEXT: return "OpHitObjectGetPrimitiveIndexEXT"; + case Op::OpHitObjectGetGeometryIndexEXT: return "OpHitObjectGetGeometryIndexEXT"; + case Op::OpHitObjectGetInstanceIdEXT: return "OpHitObjectGetInstanceIdEXT"; + case Op::OpHitObjectGetInstanceCustomIndexEXT: return "OpHitObjectGetInstanceCustomIndexEXT"; + case Op::OpHitObjectGetObjectRayOriginEXT: return "OpHitObjectGetObjectRayOriginEXT"; + case Op::OpHitObjectGetObjectRayDirectionEXT: return "OpHitObjectGetObjectRayDirectionEXT"; + case Op::OpHitObjectGetWorldRayDirectionEXT: return "OpHitObjectGetWorldRayDirectionEXT"; + case Op::OpHitObjectGetWorldRayOriginEXT: return "OpHitObjectGetWorldRayOriginEXT"; + case Op::OpHitObjectGetObjectToWorldEXT: return "OpHitObjectGetObjectToWorldEXT"; + case Op::OpHitObjectGetWorldToObjectEXT: return "OpHitObjectGetWorldToObjectEXT"; + case Op::OpHitObjectGetRayTMaxEXT: return "OpHitObjectGetRayTMaxEXT"; + case Op::OpReportIntersectionKHR: return "OpReportIntersectionKHR"; + case Op::OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; + case Op::OpTerminateRayNV: return "OpTerminateRayNV"; + case Op::OpTraceNV: return "OpTraceNV"; + case Op::OpTraceMotionNV: return "OpTraceMotionNV"; + case Op::OpTraceRayMotionNV: return "OpTraceRayMotionNV"; + case Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR"; + case Op::OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR"; + case Op::OpExecuteCallableNV: return "OpExecuteCallableNV"; + case Op::OpRayQueryGetClusterIdNV: return "OpRayQueryGetClusterIdNV"; + case Op::OpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV"; + case Op::OpHitObjectGetRayTMinEXT: return "OpHitObjectGetRayTMinEXT"; + case Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: return "OpHitObjectGetShaderBindingTableRecordIndexEXT"; + case Op::OpHitObjectGetShaderRecordBufferHandleEXT: return "OpHitObjectGetShaderRecordBufferHandleEXT"; + case Op::OpHitObjectIsEmptyEXT: return "OpHitObjectIsEmptyEXT"; + case Op::OpHitObjectIsHitEXT: return "OpHitObjectIsHitEXT"; + case Op::OpHitObjectIsMissEXT: return "OpHitObjectIsMissEXT"; + case Op::OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; + case Op::OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; + case Op::OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV"; + case Op::OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV"; + case Op::OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV"; + case Op::OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT"; + case Op::OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT"; + case Op::OpCooperativeMatrixReduceNV: return "OpCooperativeMatrixReduceNV"; + case Op::OpCooperativeMatrixLoadTensorNV: return "OpCooperativeMatrixLoadTensorNV"; + case Op::OpCooperativeMatrixStoreTensorNV: return "OpCooperativeMatrixStoreTensorNV"; + case Op::OpCooperativeMatrixPerElementOpNV: return "OpCooperativeMatrixPerElementOpNV"; + case Op::OpTypeTensorLayoutNV: return "OpTypeTensorLayoutNV"; + case Op::OpTypeTensorViewNV: return "OpTypeTensorViewNV"; + case Op::OpCreateTensorLayoutNV: return "OpCreateTensorLayoutNV"; + case Op::OpTensorLayoutSetDimensionNV: return "OpTensorLayoutSetDimensionNV"; + case Op::OpTensorLayoutSetStrideNV: return "OpTensorLayoutSetStrideNV"; + case Op::OpTensorLayoutSliceNV: return "OpTensorLayoutSliceNV"; + case Op::OpTensorLayoutSetClampValueNV: return "OpTensorLayoutSetClampValueNV"; + case Op::OpCreateTensorViewNV: return "OpCreateTensorViewNV"; + case Op::OpTensorViewSetDimensionNV: return "OpTensorViewSetDimensionNV"; + case Op::OpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV"; + case Op::OpDemoteToHelperInvocation: return "OpDemoteToHelperInvocation"; + case Op::OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT"; + case Op::OpTensorViewSetClipNV: return "OpTensorViewSetClipNV"; + case Op::OpTensorLayoutSetBlockSizeNV: return "OpTensorLayoutSetBlockSizeNV"; + case Op::OpCooperativeMatrixTransposeNV: return "OpCooperativeMatrixTransposeNV"; + case Op::OpConvertUToImageNV: return "OpConvertUToImageNV"; + case Op::OpConvertUToSamplerNV: return "OpConvertUToSamplerNV"; + case Op::OpConvertImageToUNV: return "OpConvertImageToUNV"; + case Op::OpConvertSamplerToUNV: return "OpConvertSamplerToUNV"; + case Op::OpConvertUToSampledImageNV: return "OpConvertUToSampledImageNV"; + case Op::OpConvertSampledImageToUNV: return "OpConvertSampledImageToUNV"; + case Op::OpSamplerImageAddressingModeNV: return "OpSamplerImageAddressingModeNV"; + case Op::OpRawAccessChainNV: return "OpRawAccessChainNV"; + case Op::OpRayQueryGetIntersectionSpherePositionNV: return "OpRayQueryGetIntersectionSpherePositionNV"; + case Op::OpRayQueryGetIntersectionSphereRadiusNV: return "OpRayQueryGetIntersectionSphereRadiusNV"; + case Op::OpRayQueryGetIntersectionLSSPositionsNV: return "OpRayQueryGetIntersectionLSSPositionsNV"; + case Op::OpRayQueryGetIntersectionLSSRadiiNV: return "OpRayQueryGetIntersectionLSSRadiiNV"; + case Op::OpRayQueryGetIntersectionLSSHitValueNV: return "OpRayQueryGetIntersectionLSSHitValueNV"; + case Op::OpHitObjectGetSpherePositionNV: return "OpHitObjectGetSpherePositionNV"; + case Op::OpHitObjectGetSphereRadiusNV: return "OpHitObjectGetSphereRadiusNV"; + case Op::OpHitObjectGetLSSPositionsNV: return "OpHitObjectGetLSSPositionsNV"; + case Op::OpHitObjectGetLSSRadiiNV: return "OpHitObjectGetLSSRadiiNV"; + case Op::OpHitObjectIsSphereHitNV: return "OpHitObjectIsSphereHitNV"; + case Op::OpHitObjectIsLSSHitNV: return "OpHitObjectIsLSSHitNV"; + case Op::OpRayQueryIsSphereHitNV: return "OpRayQueryIsSphereHitNV"; + case Op::OpRayQueryIsLSSHitNV: return "OpRayQueryIsLSSHitNV"; + case Op::OpSubgroupShuffleINTEL: return "OpSubgroupShuffleINTEL"; + case Op::OpSubgroupShuffleDownINTEL: return "OpSubgroupShuffleDownINTEL"; + case Op::OpSubgroupShuffleUpINTEL: return "OpSubgroupShuffleUpINTEL"; + case Op::OpSubgroupShuffleXorINTEL: return "OpSubgroupShuffleXorINTEL"; + case Op::OpSubgroupBlockReadINTEL: return "OpSubgroupBlockReadINTEL"; + case Op::OpSubgroupBlockWriteINTEL: return "OpSubgroupBlockWriteINTEL"; + case Op::OpSubgroupImageBlockReadINTEL: return "OpSubgroupImageBlockReadINTEL"; + case Op::OpSubgroupImageBlockWriteINTEL: return "OpSubgroupImageBlockWriteINTEL"; + case Op::OpSubgroupImageMediaBlockReadINTEL: return "OpSubgroupImageMediaBlockReadINTEL"; + case Op::OpSubgroupImageMediaBlockWriteINTEL: return "OpSubgroupImageMediaBlockWriteINTEL"; + case Op::OpUCountLeadingZerosINTEL: return "OpUCountLeadingZerosINTEL"; + case Op::OpUCountTrailingZerosINTEL: return "OpUCountTrailingZerosINTEL"; + case Op::OpAbsISubINTEL: return "OpAbsISubINTEL"; + case Op::OpAbsUSubINTEL: return "OpAbsUSubINTEL"; + case Op::OpIAddSatINTEL: return "OpIAddSatINTEL"; + case Op::OpUAddSatINTEL: return "OpUAddSatINTEL"; + case Op::OpIAverageINTEL: return "OpIAverageINTEL"; + case Op::OpUAverageINTEL: return "OpUAverageINTEL"; + case Op::OpIAverageRoundedINTEL: return "OpIAverageRoundedINTEL"; + case Op::OpUAverageRoundedINTEL: return "OpUAverageRoundedINTEL"; + case Op::OpISubSatINTEL: return "OpISubSatINTEL"; + case Op::OpUSubSatINTEL: return "OpUSubSatINTEL"; + case Op::OpIMul32x16INTEL: return "OpIMul32x16INTEL"; + case Op::OpUMul32x16INTEL: return "OpUMul32x16INTEL"; + case Op::OpConstantFunctionPointerINTEL: return "OpConstantFunctionPointerINTEL"; + case Op::OpFunctionPointerCallINTEL: return "OpFunctionPointerCallINTEL"; + case Op::OpAsmTargetINTEL: return "OpAsmTargetINTEL"; + case Op::OpAsmINTEL: return "OpAsmINTEL"; + case Op::OpAsmCallINTEL: return "OpAsmCallINTEL"; + case Op::OpAtomicFMinEXT: return "OpAtomicFMinEXT"; + case Op::OpAtomicFMaxEXT: return "OpAtomicFMaxEXT"; + case Op::OpAssumeTrueKHR: return "OpAssumeTrueKHR"; + case Op::OpExpectKHR: return "OpExpectKHR"; + case Op::OpDecorateString: return "OpDecorateString"; + case Op::OpMemberDecorateString: return "OpMemberDecorateString"; + case Op::OpVmeImageINTEL: return "OpVmeImageINTEL"; + case Op::OpTypeVmeImageINTEL: return "OpTypeVmeImageINTEL"; + case Op::OpTypeAvcImePayloadINTEL: return "OpTypeAvcImePayloadINTEL"; + case Op::OpTypeAvcRefPayloadINTEL: return "OpTypeAvcRefPayloadINTEL"; + case Op::OpTypeAvcSicPayloadINTEL: return "OpTypeAvcSicPayloadINTEL"; + case Op::OpTypeAvcMcePayloadINTEL: return "OpTypeAvcMcePayloadINTEL"; + case Op::OpTypeAvcMceResultINTEL: return "OpTypeAvcMceResultINTEL"; + case Op::OpTypeAvcImeResultINTEL: return "OpTypeAvcImeResultINTEL"; + case Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL: return "OpTypeAvcImeResultSingleReferenceStreamoutINTEL"; + case Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL: return "OpTypeAvcImeResultDualReferenceStreamoutINTEL"; + case Op::OpTypeAvcImeSingleReferenceStreaminINTEL: return "OpTypeAvcImeSingleReferenceStreaminINTEL"; + case Op::OpTypeAvcImeDualReferenceStreaminINTEL: return "OpTypeAvcImeDualReferenceStreaminINTEL"; + case Op::OpTypeAvcRefResultINTEL: return "OpTypeAvcRefResultINTEL"; + case Op::OpTypeAvcSicResultINTEL: return "OpTypeAvcSicResultINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL"; + case Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL"; + case Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL: return "OpSubgroupAvcMceSetInterShapePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL"; + case Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: return "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL"; + case Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL"; + case Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL"; + case Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL"; + case Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: return "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL"; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL"; + case Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL: return "OpSubgroupAvcMceSetAcOnlyHaarINTEL"; + case Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL"; + case Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL"; + case Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL"; + case Op::OpSubgroupAvcMceConvertToImePayloadINTEL: return "OpSubgroupAvcMceConvertToImePayloadINTEL"; + case Op::OpSubgroupAvcMceConvertToImeResultINTEL: return "OpSubgroupAvcMceConvertToImeResultINTEL"; + case Op::OpSubgroupAvcMceConvertToRefPayloadINTEL: return "OpSubgroupAvcMceConvertToRefPayloadINTEL"; + case Op::OpSubgroupAvcMceConvertToRefResultINTEL: return "OpSubgroupAvcMceConvertToRefResultINTEL"; + case Op::OpSubgroupAvcMceConvertToSicPayloadINTEL: return "OpSubgroupAvcMceConvertToSicPayloadINTEL"; + case Op::OpSubgroupAvcMceConvertToSicResultINTEL: return "OpSubgroupAvcMceConvertToSicResultINTEL"; + case Op::OpSubgroupAvcMceGetMotionVectorsINTEL: return "OpSubgroupAvcMceGetMotionVectorsINTEL"; + case Op::OpSubgroupAvcMceGetInterDistortionsINTEL: return "OpSubgroupAvcMceGetInterDistortionsINTEL"; + case Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL: return "OpSubgroupAvcMceGetBestInterDistortionsINTEL"; + case Op::OpSubgroupAvcMceGetInterMajorShapeINTEL: return "OpSubgroupAvcMceGetInterMajorShapeINTEL"; + case Op::OpSubgroupAvcMceGetInterMinorShapeINTEL: return "OpSubgroupAvcMceGetInterMinorShapeINTEL"; + case Op::OpSubgroupAvcMceGetInterDirectionsINTEL: return "OpSubgroupAvcMceGetInterDirectionsINTEL"; + case Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL: return "OpSubgroupAvcMceGetInterMotionVectorCountINTEL"; + case Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL: return "OpSubgroupAvcMceGetInterReferenceIdsINTEL"; + case Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL"; + case Op::OpSubgroupAvcImeInitializeINTEL: return "OpSubgroupAvcImeInitializeINTEL"; + case Op::OpSubgroupAvcImeSetSingleReferenceINTEL: return "OpSubgroupAvcImeSetSingleReferenceINTEL"; + case Op::OpSubgroupAvcImeSetDualReferenceINTEL: return "OpSubgroupAvcImeSetDualReferenceINTEL"; + case Op::OpSubgroupAvcImeRefWindowSizeINTEL: return "OpSubgroupAvcImeRefWindowSizeINTEL"; + case Op::OpSubgroupAvcImeAdjustRefOffsetINTEL: return "OpSubgroupAvcImeAdjustRefOffsetINTEL"; + case Op::OpSubgroupAvcImeConvertToMcePayloadINTEL: return "OpSubgroupAvcImeConvertToMcePayloadINTEL"; + case Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: return "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL"; + case Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: return "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL"; + case Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: return "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL"; + case Op::OpSubgroupAvcImeSetWeightedSadINTEL: return "OpSubgroupAvcImeSetWeightedSadINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL"; + case Op::OpSubgroupAvcImeConvertToMceResultINTEL: return "OpSubgroupAvcImeConvertToMceResultINTEL"; + case Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL: return "OpSubgroupAvcImeGetDualReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL"; + case Op::OpSubgroupAvcImeGetBorderReachedINTEL: return "OpSubgroupAvcImeGetBorderReachedINTEL"; + case Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: return "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL"; + case Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: return "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL"; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL"; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL"; + case Op::OpSubgroupAvcFmeInitializeINTEL: return "OpSubgroupAvcFmeInitializeINTEL"; + case Op::OpSubgroupAvcBmeInitializeINTEL: return "OpSubgroupAvcBmeInitializeINTEL"; + case Op::OpSubgroupAvcRefConvertToMcePayloadINTEL: return "OpSubgroupAvcRefConvertToMcePayloadINTEL"; + case Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: return "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL"; + case Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL: return "OpSubgroupAvcRefSetBilinearFilterEnableINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL"; + case Op::OpSubgroupAvcRefConvertToMceResultINTEL: return "OpSubgroupAvcRefConvertToMceResultINTEL"; + case Op::OpSubgroupAvcSicInitializeINTEL: return "OpSubgroupAvcSicInitializeINTEL"; + case Op::OpSubgroupAvcSicConfigureSkcINTEL: return "OpSubgroupAvcSicConfigureSkcINTEL"; + case Op::OpSubgroupAvcSicConfigureIpeLumaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaINTEL"; + case Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL"; + case Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL: return "OpSubgroupAvcSicGetMotionVectorMaskINTEL"; + case Op::OpSubgroupAvcSicConvertToMcePayloadINTEL: return "OpSubgroupAvcSicConvertToMcePayloadINTEL"; + case Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL"; + case Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL"; + case Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL"; + case Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL: return "OpSubgroupAvcSicSetBilinearFilterEnableINTEL"; + case Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: return "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL"; + case Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: return "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL"; + case Op::OpSubgroupAvcSicEvaluateIpeINTEL: return "OpSubgroupAvcSicEvaluateIpeINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL"; + case Op::OpSubgroupAvcSicConvertToMceResultINTEL: return "OpSubgroupAvcSicConvertToMceResultINTEL"; + case Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL: return "OpSubgroupAvcSicGetIpeLumaShapeINTEL"; + case Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL"; + case Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL"; + case Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: return "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL"; + case Op::OpSubgroupAvcSicGetIpeChromaModeINTEL: return "OpSubgroupAvcSicGetIpeChromaModeINTEL"; + case Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL"; + case Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL"; + case Op::OpSubgroupAvcSicGetInterRawSadsINTEL: return "OpSubgroupAvcSicGetInterRawSadsINTEL"; + case Op::OpVariableLengthArrayINTEL: return "OpVariableLengthArrayINTEL"; + case Op::OpSaveMemoryINTEL: return "OpSaveMemoryINTEL"; + case Op::OpRestoreMemoryINTEL: return "OpRestoreMemoryINTEL"; + case Op::OpArbitraryFloatSinCosPiINTEL: return "OpArbitraryFloatSinCosPiINTEL"; + case Op::OpArbitraryFloatCastINTEL: return "OpArbitraryFloatCastINTEL"; + case Op::OpArbitraryFloatCastFromIntINTEL: return "OpArbitraryFloatCastFromIntINTEL"; + case Op::OpArbitraryFloatCastToIntINTEL: return "OpArbitraryFloatCastToIntINTEL"; + case Op::OpArbitraryFloatAddINTEL: return "OpArbitraryFloatAddINTEL"; + case Op::OpArbitraryFloatSubINTEL: return "OpArbitraryFloatSubINTEL"; + case Op::OpArbitraryFloatMulINTEL: return "OpArbitraryFloatMulINTEL"; + case Op::OpArbitraryFloatDivINTEL: return "OpArbitraryFloatDivINTEL"; + case Op::OpArbitraryFloatGTINTEL: return "OpArbitraryFloatGTINTEL"; + case Op::OpArbitraryFloatGEINTEL: return "OpArbitraryFloatGEINTEL"; + case Op::OpArbitraryFloatLTINTEL: return "OpArbitraryFloatLTINTEL"; + case Op::OpArbitraryFloatLEINTEL: return "OpArbitraryFloatLEINTEL"; + case Op::OpArbitraryFloatEQINTEL: return "OpArbitraryFloatEQINTEL"; + case Op::OpArbitraryFloatRecipINTEL: return "OpArbitraryFloatRecipINTEL"; + case Op::OpArbitraryFloatRSqrtINTEL: return "OpArbitraryFloatRSqrtINTEL"; + case Op::OpArbitraryFloatCbrtINTEL: return "OpArbitraryFloatCbrtINTEL"; + case Op::OpArbitraryFloatHypotINTEL: return "OpArbitraryFloatHypotINTEL"; + case Op::OpArbitraryFloatSqrtINTEL: return "OpArbitraryFloatSqrtINTEL"; + case Op::OpArbitraryFloatLogINTEL: return "OpArbitraryFloatLogINTEL"; + case Op::OpArbitraryFloatLog2INTEL: return "OpArbitraryFloatLog2INTEL"; + case Op::OpArbitraryFloatLog10INTEL: return "OpArbitraryFloatLog10INTEL"; + case Op::OpArbitraryFloatLog1pINTEL: return "OpArbitraryFloatLog1pINTEL"; + case Op::OpArbitraryFloatExpINTEL: return "OpArbitraryFloatExpINTEL"; + case Op::OpArbitraryFloatExp2INTEL: return "OpArbitraryFloatExp2INTEL"; + case Op::OpArbitraryFloatExp10INTEL: return "OpArbitraryFloatExp10INTEL"; + case Op::OpArbitraryFloatExpm1INTEL: return "OpArbitraryFloatExpm1INTEL"; + case Op::OpArbitraryFloatSinINTEL: return "OpArbitraryFloatSinINTEL"; + case Op::OpArbitraryFloatCosINTEL: return "OpArbitraryFloatCosINTEL"; + case Op::OpArbitraryFloatSinCosINTEL: return "OpArbitraryFloatSinCosINTEL"; + case Op::OpArbitraryFloatSinPiINTEL: return "OpArbitraryFloatSinPiINTEL"; + case Op::OpArbitraryFloatCosPiINTEL: return "OpArbitraryFloatCosPiINTEL"; + case Op::OpArbitraryFloatASinINTEL: return "OpArbitraryFloatASinINTEL"; + case Op::OpArbitraryFloatASinPiINTEL: return "OpArbitraryFloatASinPiINTEL"; + case Op::OpArbitraryFloatACosINTEL: return "OpArbitraryFloatACosINTEL"; + case Op::OpArbitraryFloatACosPiINTEL: return "OpArbitraryFloatACosPiINTEL"; + case Op::OpArbitraryFloatATanINTEL: return "OpArbitraryFloatATanINTEL"; + case Op::OpArbitraryFloatATanPiINTEL: return "OpArbitraryFloatATanPiINTEL"; + case Op::OpArbitraryFloatATan2INTEL: return "OpArbitraryFloatATan2INTEL"; + case Op::OpArbitraryFloatPowINTEL: return "OpArbitraryFloatPowINTEL"; + case Op::OpArbitraryFloatPowRINTEL: return "OpArbitraryFloatPowRINTEL"; + case Op::OpArbitraryFloatPowNINTEL: return "OpArbitraryFloatPowNINTEL"; + case Op::OpLoopControlINTEL: return "OpLoopControlINTEL"; + case Op::OpAliasDomainDeclINTEL: return "OpAliasDomainDeclINTEL"; + case Op::OpAliasScopeDeclINTEL: return "OpAliasScopeDeclINTEL"; + case Op::OpAliasScopeListDeclINTEL: return "OpAliasScopeListDeclINTEL"; + case Op::OpFixedSqrtINTEL: return "OpFixedSqrtINTEL"; + case Op::OpFixedRecipINTEL: return "OpFixedRecipINTEL"; + case Op::OpFixedRsqrtINTEL: return "OpFixedRsqrtINTEL"; + case Op::OpFixedSinINTEL: return "OpFixedSinINTEL"; + case Op::OpFixedCosINTEL: return "OpFixedCosINTEL"; + case Op::OpFixedSinCosINTEL: return "OpFixedSinCosINTEL"; + case Op::OpFixedSinPiINTEL: return "OpFixedSinPiINTEL"; + case Op::OpFixedCosPiINTEL: return "OpFixedCosPiINTEL"; + case Op::OpFixedSinCosPiINTEL: return "OpFixedSinCosPiINTEL"; + case Op::OpFixedLogINTEL: return "OpFixedLogINTEL"; + case Op::OpFixedExpINTEL: return "OpFixedExpINTEL"; + case Op::OpPtrCastToCrossWorkgroupINTEL: return "OpPtrCastToCrossWorkgroupINTEL"; + case Op::OpCrossWorkgroupCastToPtrINTEL: return "OpCrossWorkgroupCastToPtrINTEL"; + case Op::OpReadPipeBlockingINTEL: return "OpReadPipeBlockingINTEL"; + case Op::OpWritePipeBlockingINTEL: return "OpWritePipeBlockingINTEL"; + case Op::OpFPGARegINTEL: return "OpFPGARegINTEL"; + case Op::OpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR"; + case Op::OpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR"; + case Op::OpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR"; + case Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR"; + case Op::OpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR"; + case Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR"; + case Op::OpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR"; + case Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR"; + case Op::OpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR"; + case Op::OpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR"; + case Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR"; + case Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR"; + case Op::OpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR"; + case Op::OpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR"; + case Op::OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR"; + case Op::OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR"; + case Op::OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR"; + case Op::OpAtomicFAddEXT: return "OpAtomicFAddEXT"; + case Op::OpTypeBufferSurfaceINTEL: return "OpTypeBufferSurfaceINTEL"; + case Op::OpTypeStructContinuedINTEL: return "OpTypeStructContinuedINTEL"; + case Op::OpConstantCompositeContinuedINTEL: return "OpConstantCompositeContinuedINTEL"; + case Op::OpSpecConstantCompositeContinuedINTEL: return "OpSpecConstantCompositeContinuedINTEL"; + case Op::OpCompositeConstructContinuedINTEL: return "OpCompositeConstructContinuedINTEL"; + case Op::OpConvertFToBF16INTEL: return "OpConvertFToBF16INTEL"; + case Op::OpConvertBF16ToFINTEL: return "OpConvertBF16ToFINTEL"; + case Op::OpControlBarrierArriveINTEL: return "OpControlBarrierArriveINTEL"; + case Op::OpControlBarrierWaitINTEL: return "OpControlBarrierWaitINTEL"; + case Op::OpArithmeticFenceEXT: return "OpArithmeticFenceEXT"; + case Op::OpSubgroupBlockPrefetchINTEL: return "OpSubgroupBlockPrefetchINTEL"; + case Op::OpSubgroup2DBlockLoadINTEL: return "OpSubgroup2DBlockLoadINTEL"; + case Op::OpSubgroup2DBlockLoadTransformINTEL: return "OpSubgroup2DBlockLoadTransformINTEL"; + case Op::OpSubgroup2DBlockLoadTransposeINTEL: return "OpSubgroup2DBlockLoadTransposeINTEL"; + case Op::OpSubgroup2DBlockPrefetchINTEL: return "OpSubgroup2DBlockPrefetchINTEL"; + case Op::OpSubgroup2DBlockStoreINTEL: return "OpSubgroup2DBlockStoreINTEL"; + case Op::OpSubgroupMatrixMultiplyAccumulateINTEL: return "OpSubgroupMatrixMultiplyAccumulateINTEL"; + case Op::OpGroupIMulKHR: return "OpGroupIMulKHR"; + case Op::OpGroupFMulKHR: return "OpGroupFMulKHR"; + case Op::OpGroupBitwiseAndKHR: return "OpGroupBitwiseAndKHR"; + case Op::OpGroupBitwiseOrKHR: return "OpGroupBitwiseOrKHR"; + case Op::OpGroupBitwiseXorKHR: return "OpGroupBitwiseXorKHR"; + case Op::OpGroupLogicalAndKHR: return "OpGroupLogicalAndKHR"; + case Op::OpGroupLogicalOrKHR: return "OpGroupLogicalOrKHR"; + case Op::OpGroupLogicalXorKHR: return "OpGroupLogicalXorKHR"; + case Op::OpMaskedGatherINTEL: return "OpMaskedGatherINTEL"; + case Op::OpMaskedScatterINTEL: return "OpMaskedScatterINTEL"; + default: return "Unknown"; + } +} + +#endif /* SPV_ENABLE_UTILITY_CODE */ + +// Overload bitwise operators for mask bit combining + +constexpr ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +constexpr ImageOperandsMask operator&(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) & unsigned(b)); } +constexpr ImageOperandsMask operator^(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr ImageOperandsMask operator~(ImageOperandsMask a) { return ImageOperandsMask(~unsigned(a)); } +constexpr FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +constexpr FPFastMathModeMask operator&(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) & unsigned(b)); } +constexpr FPFastMathModeMask operator^(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) ^ unsigned(b)); } +constexpr FPFastMathModeMask operator~(FPFastMathModeMask a) { return FPFastMathModeMask(~unsigned(a)); } +constexpr SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +constexpr SelectionControlMask operator&(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) & unsigned(b)); } +constexpr SelectionControlMask operator^(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) ^ unsigned(b)); } +constexpr SelectionControlMask operator~(SelectionControlMask a) { return SelectionControlMask(~unsigned(a)); } +constexpr LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +constexpr LoopControlMask operator&(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) & unsigned(b)); } +constexpr LoopControlMask operator^(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) ^ unsigned(b)); } +constexpr LoopControlMask operator~(LoopControlMask a) { return LoopControlMask(~unsigned(a)); } +constexpr FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +constexpr FunctionControlMask operator&(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) & unsigned(b)); } +constexpr FunctionControlMask operator^(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) ^ unsigned(b)); } +constexpr FunctionControlMask operator~(FunctionControlMask a) { return FunctionControlMask(~unsigned(a)); } +constexpr MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +constexpr MemorySemanticsMask operator&(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) & unsigned(b)); } +constexpr MemorySemanticsMask operator^(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) ^ unsigned(b)); } +constexpr MemorySemanticsMask operator~(MemorySemanticsMask a) { return MemorySemanticsMask(~unsigned(a)); } +constexpr MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +constexpr MemoryAccessMask operator&(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) & unsigned(b)); } +constexpr MemoryAccessMask operator^(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) ^ unsigned(b)); } +constexpr MemoryAccessMask operator~(MemoryAccessMask a) { return MemoryAccessMask(~unsigned(a)); } +constexpr KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } +constexpr KernelProfilingInfoMask operator&(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) & unsigned(b)); } +constexpr KernelProfilingInfoMask operator^(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) ^ unsigned(b)); } +constexpr KernelProfilingInfoMask operator~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask(~unsigned(a)); } +constexpr RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); } +constexpr RayFlagsMask operator&(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) & unsigned(b)); } +constexpr RayFlagsMask operator^(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) ^ unsigned(b)); } +constexpr RayFlagsMask operator~(RayFlagsMask a) { return RayFlagsMask(~unsigned(a)); } +constexpr FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); } +constexpr FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); } +constexpr FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); } +constexpr FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); } +constexpr CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); } +constexpr CooperativeMatrixReduceMask operator|(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) | unsigned(b)); } +constexpr CooperativeMatrixReduceMask operator&(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) & unsigned(b)); } +constexpr CooperativeMatrixReduceMask operator^(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) ^ unsigned(b)); } +constexpr CooperativeMatrixReduceMask operator~(CooperativeMatrixReduceMask a) { return CooperativeMatrixReduceMask(~unsigned(a)); } +constexpr TensorAddressingOperandsMask operator|(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) | unsigned(b)); } +constexpr TensorAddressingOperandsMask operator&(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) & unsigned(b)); } +constexpr TensorAddressingOperandsMask operator^(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr TensorAddressingOperandsMask operator~(TensorAddressingOperandsMask a) { return TensorAddressingOperandsMask(~unsigned(a)); } +constexpr TensorOperandsMask operator|(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) | unsigned(b)); } +constexpr TensorOperandsMask operator&(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) & unsigned(b)); } +constexpr TensorOperandsMask operator^(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr TensorOperandsMask operator~(TensorOperandsMask a) { return TensorOperandsMask(~unsigned(a)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator|(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) | unsigned(b)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator&(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) & unsigned(b)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator^(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator~(MatrixMultiplyAccumulateOperandsMask a) { return MatrixMultiplyAccumulateOperandsMask(~unsigned(a)); } +constexpr RawAccessChainOperandsMask operator|(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) | unsigned(b)); } +constexpr RawAccessChainOperandsMask operator&(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) & unsigned(b)); } +constexpr RawAccessChainOperandsMask operator^(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr RawAccessChainOperandsMask operator~(RawAccessChainOperandsMask a) { return RawAccessChainOperandsMask(~unsigned(a)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff --git a/app/libs/ncnn/arm64-v8a/include/glslang/build_info.h b/app/libs/ncnn/arm64-v8a/include/glslang/build_info.h new file mode 100644 index 0000000..7816b66 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/glslang/build_info.h @@ -0,0 +1,62 @@ +// Copyright (C) 2020 The Khronos Group Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of The Khronos Group Inc. 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 HOLDERS 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. + +#ifndef GLSLANG_BUILD_INFO +#define GLSLANG_BUILD_INFO + +#define GLSLANG_VERSION_MAJOR 16 +#define GLSLANG_VERSION_MINOR 1 +#define GLSLANG_VERSION_PATCH 0 +#define GLSLANG_VERSION_FLAVOR "" + +#define GLSLANG_VERSION_GREATER_THAN(major, minor, patch) \ + ((GLSLANG_VERSION_MAJOR) > (major) || ((major) == GLSLANG_VERSION_MAJOR && \ + ((GLSLANG_VERSION_MINOR) > (minor) || ((minor) == GLSLANG_VERSION_MINOR && \ + (GLSLANG_VERSION_PATCH) > (patch))))) + +#define GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch) \ + ((GLSLANG_VERSION_MAJOR) > (major) || ((major) == GLSLANG_VERSION_MAJOR && \ + ((GLSLANG_VERSION_MINOR) > (minor) || ((minor) == GLSLANG_VERSION_MINOR && \ + (GLSLANG_VERSION_PATCH >= (patch)))))) + +#define GLSLANG_VERSION_LESS_THAN(major, minor, patch) \ + ((GLSLANG_VERSION_MAJOR) < (major) || ((major) == GLSLANG_VERSION_MAJOR && \ + ((GLSLANG_VERSION_MINOR) < (minor) || ((minor) == GLSLANG_VERSION_MINOR && \ + (GLSLANG_VERSION_PATCH) < (patch))))) + +#define GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch) \ + ((GLSLANG_VERSION_MAJOR) < (major) || ((major) == GLSLANG_VERSION_MAJOR && \ + ((GLSLANG_VERSION_MINOR) < (minor) || ((minor) == GLSLANG_VERSION_MINOR && \ + (GLSLANG_VERSION_PATCH <= (patch)))))) + +#endif // GLSLANG_BUILD_INFO diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/allocator.h b/app/libs/ncnn/arm64-v8a/include/ncnn/allocator.h new file mode 100644 index 0000000..14ff4d5 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/allocator.h @@ -0,0 +1,442 @@ +// Copyright 2018 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_ALLOCATOR_H +#define NCNN_ALLOCATOR_H + +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif + +#include "platform.h" + +#include + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 +#include +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + +namespace ncnn { + +// the alignment of all the allocated buffers +#if NCNN_AVX512 +#define NCNN_MALLOC_ALIGN 64 +#elif NCNN_AVX +#define NCNN_MALLOC_ALIGN 32 +#else +#define NCNN_MALLOC_ALIGN 16 +#endif + +// we have some optimized kernels that may overread buffer a bit in loop +// it is common to interleave next-loop data load with arithmetic instructions +// allocating more bytes keeps us safe from SEGV_ACCERR failure +#define NCNN_MALLOC_OVERREAD 64 + +// Aligns a pointer to the specified number of bytes +// ptr Aligned pointer +// n Alignment size that must be a power of two +template +static NCNN_FORCEINLINE _Tp* alignPtr(_Tp* ptr, int n = (int)sizeof(_Tp)) +{ + return (_Tp*)(((size_t)ptr + n - 1) & -n); +} + +// Aligns a buffer size to the specified number of bytes +// The function returns the minimum number that is greater or equal to sz and is divisible by n +// sz Buffer size to align +// n Alignment size that must be a power of two +static NCNN_FORCEINLINE size_t alignSize(size_t sz, int n) +{ + return (sz + n - 1) & -n; +} + +static NCNN_FORCEINLINE void* fastMalloc(size_t size) +{ +#if _MSC_VER + return _aligned_malloc(size + NCNN_MALLOC_OVERREAD, NCNN_MALLOC_ALIGN); +#elif (defined(__unix__) || defined(__APPLE__)) && _POSIX_C_SOURCE >= 200112L || (__ANDROID__ && __ANDROID_API__ >= 17) + void* ptr = 0; + if (posix_memalign(&ptr, NCNN_MALLOC_ALIGN, size + NCNN_MALLOC_OVERREAD)) + ptr = 0; + return ptr; +#elif __ANDROID__ && __ANDROID_API__ < 17 + return memalign(NCNN_MALLOC_ALIGN, size + NCNN_MALLOC_OVERREAD); +#else + unsigned char* udata = (unsigned char*)malloc(size + sizeof(void*) + NCNN_MALLOC_ALIGN + NCNN_MALLOC_OVERREAD); + if (!udata) + return 0; + unsigned char** adata = alignPtr((unsigned char**)udata + 1, NCNN_MALLOC_ALIGN); + adata[-1] = udata; + return adata; +#endif +} + +static NCNN_FORCEINLINE void fastFree(void* ptr) +{ + if (ptr) + { +#if _MSC_VER + _aligned_free(ptr); +#elif (defined(__unix__) || defined(__APPLE__)) && _POSIX_C_SOURCE >= 200112L || (__ANDROID__ && __ANDROID_API__ >= 17) + free(ptr); +#elif __ANDROID__ && __ANDROID_API__ < 17 + free(ptr); +#else + unsigned char* udata = ((unsigned char**)ptr)[-1]; + free(udata); +#endif + } +} + +#if NCNN_THREADS +// exchange-add operation for atomic operations on reference counters +#if defined __riscv && !defined __riscv_atomic +// riscv target without A extension +static NCNN_FORCEINLINE int NCNN_XADD(int* addr, int delta) +{ + int tmp = *addr; + *addr += delta; + return tmp; +} +#elif defined __INTEL_COMPILER && !(defined WIN32 || defined _WIN32) +// atomic increment on the linux version of the Intel(tm) compiler +#define NCNN_XADD(addr, delta) (int)_InterlockedExchangeAdd(const_cast(reinterpret_cast(addr)), delta) +#elif defined __GNUC__ +#if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__) +#ifdef __ATOMIC_ACQ_REL +#define NCNN_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL) +#else +#define NCNN_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), delta, 4) +#endif +#else +#if defined __ATOMIC_ACQ_REL && !defined __clang__ +// version for gcc >= 4.7 +#define NCNN_XADD(addr, delta) (int)__atomic_fetch_add((unsigned*)(addr), (unsigned)(delta), __ATOMIC_ACQ_REL) +#else +#define NCNN_XADD(addr, delta) (int)__sync_fetch_and_add((unsigned*)(addr), (unsigned)(delta)) +#endif +#endif +#elif defined _MSC_VER && !defined RC_INVOKED +#define NCNN_XADD(addr, delta) (int)_InterlockedExchangeAdd((long volatile*)addr, delta) +#else +// thread-unsafe branch +static NCNN_FORCEINLINE int NCNN_XADD(int* addr, int delta) +{ + int tmp = *addr; + *addr += delta; + return tmp; +} +#endif +#else // NCNN_THREADS +static NCNN_FORCEINLINE int NCNN_XADD(int* addr, int delta) +{ + int tmp = *addr; + *addr += delta; + return tmp; +} +#endif // NCNN_THREADS + +class NCNN_EXPORT Allocator +{ +public: + virtual ~Allocator(); + virtual void* fastMalloc(size_t size) = 0; + virtual void fastFree(void* ptr) = 0; +}; + +class PoolAllocatorPrivate; +class NCNN_EXPORT PoolAllocator : public Allocator +{ +public: + PoolAllocator(); + ~PoolAllocator(); + + // ratio range 0 ~ 1 + // default cr = 0 + void set_size_compare_ratio(float scr); + + // budget drop threshold + // default threshold = 10 + void set_size_drop_threshold(size_t); + + // release all budgets immediately + void clear(); + + virtual void* fastMalloc(size_t size); + virtual void fastFree(void* ptr); + +private: + PoolAllocator(const PoolAllocator&); + PoolAllocator& operator=(const PoolAllocator&); + +private: + PoolAllocatorPrivate* const d; +}; + +class UnlockedPoolAllocatorPrivate; +class NCNN_EXPORT UnlockedPoolAllocator : public Allocator +{ +public: + UnlockedPoolAllocator(); + ~UnlockedPoolAllocator(); + + // ratio range 0 ~ 1 + // default cr = 0 + void set_size_compare_ratio(float scr); + + // budget drop threshold + // default threshold = 10 + void set_size_drop_threshold(size_t); + + // release all budgets immediately + void clear(); + + virtual void* fastMalloc(size_t size); + virtual void fastFree(void* ptr); + +private: + UnlockedPoolAllocator(const UnlockedPoolAllocator&); + UnlockedPoolAllocator& operator=(const UnlockedPoolAllocator&); + +private: + UnlockedPoolAllocatorPrivate* const d; +}; + +#if NCNN_VULKAN + +class VulkanDevice; + +class NCNN_EXPORT VkBufferMemory +{ +public: + VkBuffer buffer; + + // the base offset assigned by allocator + size_t offset; + size_t capacity; + + VkDeviceMemory memory; + void* mapped_ptr; + + uint32_t memory_type_index; + + // buffer state, modified by command functions internally + mutable VkAccessFlags access_flags; + mutable VkPipelineStageFlags stage_flags; + + // initialize and modified by mat + int refcount; +}; + +class NCNN_EXPORT VkImageMemory +{ +public: + VkImage image; + VkImageView imageview; + + // underlying info assigned by allocator + int width; + int height; + int depth; + VkFormat format; + + VkDeviceMemory memory; + void* mapped_ptr; + + uint32_t memory_type_index; + + // the base offset assigned by allocator + size_t bind_offset; + size_t bind_capacity; + + // image state, modified by command functions internally + mutable VkAccessFlags access_flags; + mutable VkImageLayout image_layout; + mutable VkPipelineStageFlags stage_flags; + + // in-execution state, modified by command functions internally + mutable int command_refcount; + + // initialize and modified by mat + int refcount; +}; + +class NCNN_EXPORT VkAllocator +{ +public: + explicit VkAllocator(const VulkanDevice* _vkdev); + virtual ~VkAllocator(); + + virtual void clear(); + + virtual VkBufferMemory* fastMalloc(size_t size) = 0; + virtual void fastFree(VkBufferMemory* ptr) = 0; + virtual int flush(VkBufferMemory* ptr); + virtual int invalidate(VkBufferMemory* ptr); + + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack) = 0; + virtual void fastFree(VkImageMemory* ptr) = 0; + +public: + const VulkanDevice* vkdev; + uint32_t buffer_memory_type_index; + uint32_t image_memory_type_index; + uint32_t reserved_type_index; + bool mappable; + bool coherent; + +protected: + VkBuffer create_buffer(size_t size, VkBufferUsageFlags usage); + VkDeviceMemory allocate_memory(size_t size, uint32_t memory_type_index); + VkDeviceMemory allocate_dedicated_memory(size_t size, uint32_t memory_type_index, VkImage image, VkBuffer buffer); + VkDeviceMemory allocate_import_host_memory(size_t size, uint32_t memory_type_index, void* host_ptr); + + VkImage create_image(int width, int height, int depth, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage); + VkImageView create_imageview(VkImage image, VkFormat format); +}; + +class VkBlobAllocatorPrivate; +class NCNN_EXPORT VkBlobAllocator : public VkAllocator +{ +public: + explicit VkBlobAllocator(const VulkanDevice* vkdev, size_t preferred_block_size = 16 * 1024 * 1024); // 16M + virtual ~VkBlobAllocator(); + +public: + // release all budgets immediately + virtual void clear(); + + virtual VkBufferMemory* fastMalloc(size_t size); + virtual void fastFree(VkBufferMemory* ptr); + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack); + virtual void fastFree(VkImageMemory* ptr); + +private: + VkBlobAllocator(const VkBlobAllocator&); + VkBlobAllocator& operator=(const VkBlobAllocator&); + +private: + VkBlobAllocatorPrivate* const d; +}; + +class VkWeightAllocatorPrivate; +class NCNN_EXPORT VkWeightAllocator : public VkAllocator +{ +public: + explicit VkWeightAllocator(const VulkanDevice* vkdev, bool prefer_host_memory = false, size_t preferred_block_size = 8 * 1024 * 1024); // 8M + explicit VkWeightAllocator(const VulkanDevice* vkdev, size_t preferred_block_size) + : VkWeightAllocator(vkdev, false, preferred_block_size) + { + } + virtual ~VkWeightAllocator(); + +public: + // release all blocks immediately + virtual void clear(); + +public: + virtual VkBufferMemory* fastMalloc(size_t size); + virtual void fastFree(VkBufferMemory* ptr); + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack); + virtual void fastFree(VkImageMemory* ptr); + +private: + VkWeightAllocator(const VkWeightAllocator&); + VkWeightAllocator& operator=(const VkWeightAllocator&); + +private: + VkWeightAllocatorPrivate* const d; +}; + +class VkStagingAllocatorPrivate; +class NCNN_EXPORT VkStagingAllocator : public VkAllocator +{ +public: + explicit VkStagingAllocator(const VulkanDevice* vkdev); + virtual ~VkStagingAllocator(); + +public: + // ratio range 0 ~ 1 + // default cr = 0.75 + void set_size_compare_ratio(float scr); + + // release all budgets immediately + virtual void clear(); + + virtual VkBufferMemory* fastMalloc(size_t size); + virtual void fastFree(VkBufferMemory* ptr); + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack); + virtual void fastFree(VkImageMemory* ptr); + +private: + VkStagingAllocator(const VkStagingAllocator&); + VkStagingAllocator& operator=(const VkStagingAllocator&); + +private: + VkStagingAllocatorPrivate* const d; +}; + +class VkWeightStagingAllocatorPrivate; +class NCNN_EXPORT VkWeightStagingAllocator : public VkAllocator +{ +public: + explicit VkWeightStagingAllocator(const VulkanDevice* vkdev); + virtual ~VkWeightStagingAllocator(); + +public: + virtual VkBufferMemory* fastMalloc(size_t size); + virtual void fastFree(VkBufferMemory* ptr); + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack); + virtual void fastFree(VkImageMemory* ptr); + +private: + VkWeightStagingAllocator(const VkWeightStagingAllocator&); + VkWeightStagingAllocator& operator=(const VkWeightStagingAllocator&); + +private: + VkWeightStagingAllocatorPrivate* const d; +}; + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 +class NCNN_EXPORT VkAndroidHardwareBufferImageAllocator : public VkAllocator +{ +public: + VkAndroidHardwareBufferImageAllocator(const VulkanDevice* _vkdev, AHardwareBuffer* _hb); + virtual ~VkAndroidHardwareBufferImageAllocator(); + +public: + virtual VkBufferMemory* fastMalloc(size_t size); + virtual void fastFree(VkBufferMemory* ptr); + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack); + virtual void fastFree(VkImageMemory* ptr); + +private: + VkAndroidHardwareBufferImageAllocator(const VkAndroidHardwareBufferImageAllocator&); + VkAndroidHardwareBufferImageAllocator& operator=(const VkAndroidHardwareBufferImageAllocator&); + +public: + int init(); + + int width() const; + int height() const; + uint64_t external_format() const; + +public: + AHardwareBuffer* hb; + AHardwareBuffer_Desc bufferDesc; + VkAndroidHardwareBufferFormatPropertiesANDROID bufferFormatProperties; + VkAndroidHardwareBufferPropertiesANDROID bufferProperties; + VkSamplerYcbcrConversionKHR samplerYcbcrConversion; +}; +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + +#endif // NCNN_VULKAN + +} // namespace ncnn + +#endif // NCNN_ALLOCATOR_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/benchmark.h b/app/libs/ncnn/arm64-v8a/include/ncnn/benchmark.h new file mode 100644 index 0000000..5df5026 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/benchmark.h @@ -0,0 +1,28 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_BENCHMARK_H +#define NCNN_BENCHMARK_H + +#include "layer.h" +#include "mat.h" +#include "platform.h" + +namespace ncnn { + +// get now timestamp in ms +NCNN_EXPORT double get_current_time(); + +// sleep milliseconds +NCNN_EXPORT void sleep(unsigned long long int milliseconds = 1000); + +#if NCNN_BENCHMARK + +NCNN_EXPORT void benchmark(const Layer* layer, double start, double end); +NCNN_EXPORT void benchmark(const Layer* layer, const Mat& bottom_blob, Mat& top_blob, double start, double end); + +#endif // NCNN_BENCHMARK + +} // namespace ncnn + +#endif // NCNN_BENCHMARK_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/blob.h b/app/libs/ncnn/arm64-v8a/include/ncnn/blob.h new file mode 100644 index 0000000..212e719 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/blob.h @@ -0,0 +1,33 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_BLOB_H +#define NCNN_BLOB_H + +#include "mat.h" +#include "platform.h" + +namespace ncnn { + +class NCNN_EXPORT Blob +{ +public: + // empty + Blob(); + +public: +#if NCNN_STRING + // blob name + std::string name; +#endif // NCNN_STRING + // layer index which produce this blob as output + int producer; + // layer index which need this blob as input + int consumer; + // shape hint + Mat shape; +}; + +} // namespace ncnn + +#endif // NCNN_BLOB_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/c_api.h b/app/libs/ncnn/arm64-v8a/include/ncnn/c_api.h new file mode 100644 index 0000000..918cced --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/c_api.h @@ -0,0 +1,424 @@ +/* Copyright 2020 Tencent + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef NCNN_C_API_H +#define NCNN_C_API_H + +#include "platform.h" + +#if NCNN_C_API + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +NCNN_EXPORT const char* ncnn_version(void); +NCNN_EXPORT int ncnn_version_number(void); + +/* allocator api */ +typedef struct __ncnn_allocator_t* ncnn_allocator_t; +struct NCNN_EXPORT __ncnn_allocator_t +{ + void* pthis; + + void* (*fast_malloc)(ncnn_allocator_t allocator, size_t size); + void (*fast_free)(ncnn_allocator_t allocator, void* ptr); +}; + +NCNN_EXPORT ncnn_allocator_t ncnn_allocator_create_pool_allocator(void); +NCNN_EXPORT ncnn_allocator_t ncnn_allocator_create_unlocked_pool_allocator(void); +NCNN_EXPORT void ncnn_allocator_destroy(ncnn_allocator_t allocator); + +#if NCNN_VULKAN +/* pipelinecache api */ +typedef struct __ncnn_pipelinecache_t* ncnn_pipelinecache_t; + +NCNN_EXPORT ncnn_pipelinecache_t ncnn_pipelinecache_create(int device_index); +NCNN_EXPORT void ncnn_pipelinecache_destroy(ncnn_pipelinecache_t pipelinecache); +NCNN_EXPORT void ncnn_pipelinecache_clear(ncnn_pipelinecache_t pipelinecache); +NCNN_EXPORT size_t ncnn_pipelinecache_get_size(const ncnn_pipelinecache_t pipelinecache); +NCNN_EXPORT int ncnn_pipelinecache_load_memory(ncnn_pipelinecache_t pipelinecache, const unsigned char* data, size_t size); +NCNN_EXPORT int ncnn_pipelinecache_save_memory(const ncnn_pipelinecache_t pipelinecache, unsigned char* data, size_t* size); +#if NCNN_STDIO +NCNN_EXPORT int ncnn_pipelinecache_load(ncnn_pipelinecache_t pipelinecache, const char* path); +NCNN_EXPORT int ncnn_pipelinecache_save(const ncnn_pipelinecache_t pipelinecache, const char* path); +#if _WIN32 +NCNN_EXPORT int ncnn_pipelinecache_load_w(ncnn_pipelinecache_t pipelinecache, const wchar_t* path); +NCNN_EXPORT int ncnn_pipelinecache_save_w(const ncnn_pipelinecache_t pipelinecache, const wchar_t* path); +#endif /* _WIN32 */ +#endif /* NCNN_STDIO */ +#endif /* NCNN_VULKAN */ + +/* option api */ +typedef struct __ncnn_option_t* ncnn_option_t; + +NCNN_EXPORT ncnn_option_t ncnn_option_create(void); +NCNN_EXPORT void ncnn_option_destroy(ncnn_option_t opt); + +NCNN_EXPORT int ncnn_option_get_num_threads(const ncnn_option_t opt); +NCNN_EXPORT void ncnn_option_set_num_threads(ncnn_option_t opt, int num_threads); + +NCNN_EXPORT void ncnn_option_set_blob_allocator(ncnn_option_t opt, ncnn_allocator_t allocator); +NCNN_EXPORT void ncnn_option_set_workspace_allocator(ncnn_option_t opt, ncnn_allocator_t allocator); + +NCNN_EXPORT int ncnn_option_get_use_vulkan_compute(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_local_pool_allocator(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_winograd_convolution(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_sgemm_convolution(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_packing_layout(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_fp16_packed(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_fp16_storage(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_fp16_arithmetic(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_int8_packed(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_int8_storage(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_int8_arithmetic(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_bf16_packed(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_bf16_storage(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_shader_local_memory(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_cooperative_matrix(const ncnn_option_t opt); + +NCNN_EXPORT void ncnn_option_set_use_vulkan_compute(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_local_pool_allocator(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_winograd_convolution(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_sgemm_convolution(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_packing_layout(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_fp16_packed(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_fp16_storage(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_fp16_arithmetic(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_int8_packed(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_int8_storage(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_int8_arithmetic(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_bf16_packed(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_bf16_storage(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_shader_local_memory(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_cooperative_matrix(ncnn_option_t opt, int enable); +#if NCNN_VULKAN +NCNN_EXPORT void ncnn_option_set_pipeline_cache(ncnn_option_t opt, ncnn_pipelinecache_t pipelinecache); +#endif /* NCNN_VULKAN */ + +/* mat api */ +typedef struct __ncnn_mat_t* ncnn_mat_t; + +NCNN_EXPORT ncnn_mat_t ncnn_mat_create(void); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_1d(int w, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_2d(int w, int h, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_3d(int w, int h, int c, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_4d(int w, int h, int d, int c, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_1d(int w, void* data, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_2d(int w, int h, void* data, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_3d(int w, int h, int c, void* data, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_4d(int w, int h, int d, int c, void* data, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_1d_elem(int w, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_2d_elem(int w, int h, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_3d_elem(int w, int h, int c, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_4d_elem(int w, int h, int d, int c, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_1d_elem(int w, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_2d_elem(int w, int h, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_3d_elem(int w, int h, int c, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_4d_elem(int w, int h, int d, int c, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT void ncnn_mat_destroy(ncnn_mat_t mat); + +NCNN_EXPORT void ncnn_mat_fill_float(ncnn_mat_t mat, float v); + +NCNN_EXPORT ncnn_mat_t ncnn_mat_clone(const ncnn_mat_t mat, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_1d(const ncnn_mat_t mat, int w, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_2d(const ncnn_mat_t mat, int w, int h, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_3d(const ncnn_mat_t mat, int w, int h, int c, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_4d(const ncnn_mat_t mat, int w, int h, int d, int c, ncnn_allocator_t allocator); + +NCNN_EXPORT int ncnn_mat_get_dims(const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_mat_get_w(const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_mat_get_h(const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_mat_get_d(const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_mat_get_c(const ncnn_mat_t mat); +NCNN_EXPORT size_t ncnn_mat_get_elemsize(const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_mat_get_elempack(const ncnn_mat_t mat); +NCNN_EXPORT size_t ncnn_mat_get_cstep(const ncnn_mat_t mat); +NCNN_EXPORT void* ncnn_mat_get_data(const ncnn_mat_t mat); + +NCNN_EXPORT void* ncnn_mat_get_channel_data(const ncnn_mat_t mat, int c); + +#if NCNN_PIXEL + +/* mat pixel api */ +#define NCNN_MAT_PIXEL_RGB 1 +#define NCNN_MAT_PIXEL_BGR 2 +#define NCNN_MAT_PIXEL_GRAY 3 +#define NCNN_MAT_PIXEL_RGBA 4 +#define NCNN_MAT_PIXEL_BGRA 5 +#define NCNN_MAT_PIXEL_X2Y(X, Y) (X | (Y << 16)) +NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels(const unsigned char* pixels, int type, int w, int h, int stride, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels_resize(const unsigned char* pixels, int type, int w, int h, int stride, int target_width, int target_height, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels_roi(const unsigned char* pixels, int type, int w, int h, int stride, int roix, int roiy, int roiw, int roih, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels_roi_resize(const unsigned char* pixels, int type, int w, int h, int stride, int roix, int roiy, int roiw, int roih, int target_width, int target_height, ncnn_allocator_t allocator); +NCNN_EXPORT void ncnn_mat_to_pixels(const ncnn_mat_t mat, unsigned char* pixels, int type, int stride); +NCNN_EXPORT void ncnn_mat_to_pixels_resize(const ncnn_mat_t mat, unsigned char* pixels, int type, int target_width, int target_height, int target_stride); + +#endif /* NCNN_PIXEL */ + +NCNN_EXPORT void ncnn_mat_substract_mean_normalize(ncnn_mat_t mat, const float* mean_vals, const float* norm_vals); + +NCNN_EXPORT void ncnn_convert_packing(const ncnn_mat_t src, ncnn_mat_t* dst, int elempack, const ncnn_option_t opt); +NCNN_EXPORT void ncnn_flatten(const ncnn_mat_t src, ncnn_mat_t* dst, const ncnn_option_t opt); + +/* blob api */ +typedef struct __ncnn_blob_t* ncnn_blob_t; + +#if NCNN_STRING +NCNN_EXPORT const char* ncnn_blob_get_name(const ncnn_blob_t blob); +#endif /* NCNN_STRING */ + +NCNN_EXPORT int ncnn_blob_get_producer(const ncnn_blob_t blob); +NCNN_EXPORT int ncnn_blob_get_consumer(const ncnn_blob_t blob); + +NCNN_EXPORT void ncnn_blob_get_shape(const ncnn_blob_t blob, int* dims, int* w, int* h, int* c); + +/* paramdict api */ +typedef struct __ncnn_paramdict_t* ncnn_paramdict_t; + +NCNN_EXPORT ncnn_paramdict_t ncnn_paramdict_create(void); +NCNN_EXPORT void ncnn_paramdict_destroy(ncnn_paramdict_t pd); + +NCNN_EXPORT int ncnn_paramdict_get_type(const ncnn_paramdict_t pd, int id); + +NCNN_EXPORT int ncnn_paramdict_get_int(const ncnn_paramdict_t pd, int id, int def); +NCNN_EXPORT float ncnn_paramdict_get_float(const ncnn_paramdict_t pd, int id, float def); +NCNN_EXPORT ncnn_mat_t ncnn_paramdict_get_array(const ncnn_paramdict_t pd, int id, const ncnn_mat_t def); + +NCNN_EXPORT void ncnn_paramdict_set_int(ncnn_paramdict_t pd, int id, int i); +NCNN_EXPORT void ncnn_paramdict_set_float(ncnn_paramdict_t pd, int id, float f); +NCNN_EXPORT void ncnn_paramdict_set_array(ncnn_paramdict_t pd, int id, const ncnn_mat_t v); + +/* datareader api */ +typedef struct __ncnn_datareader_t* ncnn_datareader_t; +struct NCNN_EXPORT __ncnn_datareader_t +{ + void* pthis; + +#if NCNN_STRING + int (*scan)(ncnn_datareader_t dr, const char* format, void* p); +#endif /* NCNN_STRING */ + size_t (*read)(ncnn_datareader_t dr, void* buf, size_t size); +}; + +NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create(void); +#if NCNN_STDIO +NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create_from_stdio(FILE* fp); +#endif /* NCNN_STDIO */ +NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create_from_memory(const unsigned char** mem); +NCNN_EXPORT void ncnn_datareader_destroy(ncnn_datareader_t dr); + +/* modelbin api */ +typedef struct __ncnn_modelbin_t* ncnn_modelbin_t; +struct NCNN_EXPORT __ncnn_modelbin_t +{ + void* pthis; + + ncnn_mat_t (*load_1d)(const ncnn_modelbin_t mb, int w, int type); + ncnn_mat_t (*load_2d)(const ncnn_modelbin_t mb, int w, int h, int type); + ncnn_mat_t (*load_3d)(const ncnn_modelbin_t mb, int w, int h, int c, int type); +}; + +NCNN_EXPORT ncnn_modelbin_t ncnn_modelbin_create_from_datareader(const ncnn_datareader_t dr); +NCNN_EXPORT ncnn_modelbin_t ncnn_modelbin_create_from_mat_array(const ncnn_mat_t* weights, int n); +NCNN_EXPORT void ncnn_modelbin_destroy(ncnn_modelbin_t mb); + +/* layer api */ +typedef struct __ncnn_layer_t* ncnn_layer_t; +struct NCNN_EXPORT __ncnn_layer_t +{ + void* pthis; + + int (*load_param)(ncnn_layer_t layer, const ncnn_paramdict_t pd); + int (*load_model)(ncnn_layer_t layer, const ncnn_modelbin_t mb); + + int (*create_pipeline)(ncnn_layer_t layer, const ncnn_option_t opt); + int (*destroy_pipeline)(ncnn_layer_t layer, const ncnn_option_t opt); + + int (*forward_1)(const ncnn_layer_t layer, const ncnn_mat_t bottom_blob, ncnn_mat_t* top_blob, const ncnn_option_t opt); + int (*forward_n)(const ncnn_layer_t layer, const ncnn_mat_t* bottom_blobs, int n, ncnn_mat_t* top_blobs, int n2, const ncnn_option_t opt); + + int (*forward_inplace_1)(const ncnn_layer_t layer, ncnn_mat_t bottom_top_blob, const ncnn_option_t opt); + int (*forward_inplace_n)(const ncnn_layer_t layer, ncnn_mat_t* bottom_top_blobs, int n, const ncnn_option_t opt); +}; + +NCNN_EXPORT ncnn_layer_t ncnn_layer_create(void); +NCNN_EXPORT ncnn_layer_t ncnn_layer_create_by_typeindex(int typeindex); +#if NCNN_STRING +NCNN_EXPORT ncnn_layer_t ncnn_layer_create_by_type(const char* type); +NCNN_EXPORT int ncnn_layer_type_to_index(const char* type); +#endif /* NCNN_STRING */ +NCNN_EXPORT void ncnn_layer_destroy(ncnn_layer_t layer); + +#if NCNN_STRING +NCNN_EXPORT const char* ncnn_layer_get_name(const ncnn_layer_t layer); +#endif /* NCNN_STRING */ + +NCNN_EXPORT int ncnn_layer_get_typeindex(const ncnn_layer_t layer); +#if NCNN_STRING +NCNN_EXPORT const char* ncnn_layer_get_type(const ncnn_layer_t layer); +#endif /* NCNN_STRING */ + +NCNN_EXPORT int ncnn_layer_get_one_blob_only(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_inplace(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_vulkan(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_packing(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_bf16_storage(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_fp16_storage(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_vulkan_packing(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_any_packing(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_vulkan_any_packing(const ncnn_layer_t layer); + +NCNN_EXPORT void ncnn_layer_set_one_blob_only(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_inplace(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_vulkan(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_packing(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_bf16_storage(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_fp16_storage(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_vulkan_packing(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_any_packing(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_vulkan_any_packing(ncnn_layer_t layer, int enable); + +NCNN_EXPORT int ncnn_layer_get_bottom_count(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_bottom(const ncnn_layer_t layer, int i); +NCNN_EXPORT int ncnn_layer_get_top_count(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_top(const ncnn_layer_t layer, int i); + +NCNN_EXPORT void ncnn_blob_get_bottom_shape(const ncnn_layer_t layer, int i, int* dims, int* w, int* h, int* c); +NCNN_EXPORT void ncnn_blob_get_top_shape(const ncnn_layer_t layer, int i, int* dims, int* w, int* h, int* c); + +/* layer factory function */ +typedef ncnn_layer_t (*ncnn_layer_creator_t)(void* userdata); +typedef void (*ncnn_layer_destroyer_t)(ncnn_layer_t layer, void* userdata); + +typedef struct __ncnn_net_custom_layer_factory_t* ncnn_net_custom_layer_factory_t; +struct __ncnn_net_custom_layer_factory_t +{ + ncnn_layer_creator_t creator; + ncnn_layer_destroyer_t destroyer; + void* userdata; + ncnn_net_custom_layer_factory_t next; +}; + +/* net api */ +typedef struct __ncnn_net_t* ncnn_net_t; +struct __ncnn_net_t +{ + void* pthis; + + ncnn_net_custom_layer_factory_t custom_layer_factory; +}; + +NCNN_EXPORT ncnn_net_t ncnn_net_create(void); +NCNN_EXPORT void ncnn_net_destroy(ncnn_net_t net); + +NCNN_EXPORT ncnn_option_t ncnn_net_get_option(ncnn_net_t net); +NCNN_EXPORT void ncnn_net_set_option(ncnn_net_t net, ncnn_option_t opt); + +#if NCNN_VULKAN +NCNN_EXPORT void ncnn_net_set_vulkan_device(ncnn_net_t net, int device_index); +#endif + +#if NCNN_STRING +NCNN_EXPORT void ncnn_net_register_custom_layer_by_type(ncnn_net_t net, const char* type, ncnn_layer_creator_t creator, ncnn_layer_destroyer_t destroyer, void* userdata); +#endif /* NCNN_STRING */ +NCNN_EXPORT void ncnn_net_register_custom_layer_by_typeindex(ncnn_net_t net, int typeindex, ncnn_layer_creator_t creator, ncnn_layer_destroyer_t destroyer, void* userdata); + +#if NCNN_STDIO +#if NCNN_STRING +NCNN_EXPORT int ncnn_net_load_param(ncnn_net_t net, const char* path); +#endif /* NCNN_STRING */ +NCNN_EXPORT int ncnn_net_load_param_bin(ncnn_net_t net, const char* path); +NCNN_EXPORT int ncnn_net_load_model(ncnn_net_t net, const char* path); +#if _WIN32 +#if NCNN_STRING +NCNN_EXPORT int ncnn_net_load_param_w(ncnn_net_t net, const wchar_t* path); +#endif /* NCNN_STRING */ +NCNN_EXPORT int ncnn_net_load_param_bin_w(ncnn_net_t net, const wchar_t* path); +NCNN_EXPORT int ncnn_net_load_model_w(ncnn_net_t net, const wchar_t* path); +#endif /* _WIN32 */ +#endif /* NCNN_STDIO */ + +#if NCNN_STDIO +#if NCNN_STRING +NCNN_EXPORT int ncnn_net_load_param_memory(ncnn_net_t net, const char* mem); +#endif /* NCNN_STRING */ +#endif /* NCNN_STDIO */ +NCNN_EXPORT size_t ncnn_net_load_param_bin_memory(ncnn_net_t net, const unsigned char* mem); +NCNN_EXPORT size_t ncnn_net_load_model_memory(ncnn_net_t net, const unsigned char* mem); + +#if NCNN_STRING +NCNN_EXPORT int ncnn_net_load_param_datareader(ncnn_net_t net, const ncnn_datareader_t dr); +#endif /* NCNN_STRING */ +NCNN_EXPORT int ncnn_net_load_param_bin_datareader(ncnn_net_t net, const ncnn_datareader_t dr); +NCNN_EXPORT int ncnn_net_load_model_datareader(ncnn_net_t net, const ncnn_datareader_t dr); + +NCNN_EXPORT void ncnn_net_clear(ncnn_net_t net); + +NCNN_EXPORT int ncnn_net_get_input_count(const ncnn_net_t net); +NCNN_EXPORT int ncnn_net_get_output_count(const ncnn_net_t net); +#if NCNN_STRING +NCNN_EXPORT const char* ncnn_net_get_input_name(const ncnn_net_t net, int i); +NCNN_EXPORT const char* ncnn_net_get_output_name(const ncnn_net_t net, int i); +#endif /* NCNN_STRING */ +NCNN_EXPORT int ncnn_net_get_input_index(const ncnn_net_t net, int i); +NCNN_EXPORT int ncnn_net_get_output_index(const ncnn_net_t net, int i); + +/* extractor api */ +typedef struct __ncnn_extractor_t* ncnn_extractor_t; + +NCNN_EXPORT ncnn_extractor_t ncnn_extractor_create(ncnn_net_t net); +NCNN_EXPORT void ncnn_extractor_destroy(ncnn_extractor_t ex); + +NCNN_EXPORT void ncnn_extractor_set_option(ncnn_extractor_t ex, const ncnn_option_t opt); + +#if NCNN_STRING +NCNN_EXPORT int ncnn_extractor_input(ncnn_extractor_t ex, const char* name, const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_extractor_extract(ncnn_extractor_t ex, const char* name, ncnn_mat_t* mat); +#endif /* NCNN_STRING */ +NCNN_EXPORT int ncnn_extractor_input_index(ncnn_extractor_t ex, int index, const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_extractor_extract_index(ncnn_extractor_t ex, int index, ncnn_mat_t* mat); + +/* mat process api */ +#define NCNN_BORDER_CONSTANT 0 +#define NCNN_BORDER_REPLICATE 1 +#define NCNN_BORDER_REFLECT 2 +#define NCNN_BORDER_TRANSPARENT -233 +NCNN_EXPORT void ncnn_copy_make_border(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, int type, float v, const ncnn_option_t opt); +NCNN_EXPORT void ncnn_copy_make_border_3d(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, int front, int behind, int type, float v, const ncnn_option_t opt); +NCNN_EXPORT void ncnn_copy_cut_border(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, const ncnn_option_t opt); +NCNN_EXPORT void ncnn_copy_cut_border_3d(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, int front, int behind, const ncnn_option_t opt); + +#if NCNN_PIXEL_DRAWING +/* mat pixel drawing api*/ +NCNN_EXPORT void ncnn_draw_rectangle_c1(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_rectangle_c2(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_rectangle_c3(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_rectangle_c4(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); + +NCNN_EXPORT void ncnn_draw_text_c1(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void ncnn_draw_text_c2(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void ncnn_draw_text_c3(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void ncnn_draw_text_c4(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); + +NCNN_EXPORT void ncnn_draw_circle_c1(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_circle_c2(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_circle_c3(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_circle_c4(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); + +NCNN_EXPORT void ncnn_draw_line_c1(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_line_c2(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_line_c3(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_line_c4(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +#endif /* NCNN_PIXEL_DRAWING */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* NCNN_C_API */ + +#endif /* NCNN_C_API_H */ diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/command.h b/app/libs/ncnn/arm64-v8a/include/ncnn/command.h new file mode 100644 index 0000000..a673823 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/command.h @@ -0,0 +1,117 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_COMMAND_H +#define NCNN_COMMAND_H + +#include "platform.h" + +#if NCNN_VULKAN + +#include "mat.h" + +namespace ncnn { + +class Pipeline; +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 +class ImportAndroidHardwareBufferPipeline; +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API +class VkComputePrivate; +class NCNN_EXPORT VkCompute +{ +public: + explicit VkCompute(const VulkanDevice* vkdev); + virtual ~VkCompute(); + +public: + void record_upload(const Mat& src, VkMat& dst, const Option& opt); + + void record_download(const VkMat& src, Mat& dst, const Option& opt); + + void record_clone(const Mat& src, VkMat& dst, const Option& opt); + + void record_clone(const Mat& src, VkImageMat& dst, const Option& opt); + + void record_clone(const VkMat& src, Mat& dst, const Option& opt); + + void record_clone(const VkImageMat& src, Mat& dst, const Option& opt); + + void record_clone(const VkMat& src, VkMat& dst, const Option& opt); + + void record_clone(const VkImageMat& src, VkImageMat& dst, const Option& opt); + + void record_clone(const VkMat& src, VkImageMat& dst, const Option& opt); + + void record_clone(const VkImageMat& src, VkMat& dst, const Option& opt); + + void record_pipeline(const Pipeline* pipeline, const std::vector& bindings, const std::vector& constants, const VkMat& dispatcher); + + void record_pipeline(const Pipeline* pipeline, const std::vector& bindings, const std::vector& constants, const VkImageMat& dispatcher); + + void record_pipeline(const Pipeline* pipeline, const std::vector& buffer_bindings, const std::vector& image_bindings, const std::vector& constants, const VkMat& dispatcher); + void record_pipeline(const Pipeline* pipeline, const std::vector& buffer_bindings, const std::vector& image_bindings, const std::vector& constants, const VkImageMat& dispatcher); + void record_pipeline(const Pipeline* pipeline, const std::vector& buffer_bindings, const std::vector& image_bindings, const std::vector& constants, const Mat& dispatcher); + +#if NCNN_BENCHMARK + void record_write_timestamp(uint32_t query); +#endif // NCNN_BENCHMARK + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 + void record_import_android_hardware_buffer(const ImportAndroidHardwareBufferPipeline* pipeline, const VkImageMat& src, const VkMat& dst); +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + + int submit_and_wait(); + + int reset(); + + uint64_t pending_dispatch_total() const; + +#if NCNN_BENCHMARK + int create_query_pool(uint32_t query_count); + + int get_query_pool_results(uint32_t first_query, uint32_t query_count, std::vector& results); +#endif // NCNN_BENCHMARK + +protected: + const VulkanDevice* vkdev; + + void barrier_readwrite(const VkMat& binding); + void barrier_readwrite(const VkImageMat& binding); + void barrier_readonly(const VkImageMat& binding); + +private: + VkComputePrivate* const d; +}; + +class VkTransferPrivate; +class NCNN_EXPORT VkTransfer +{ +public: + explicit VkTransfer(const VulkanDevice* vkdev); + virtual ~VkTransfer(); + +public: + void record_upload(const Mat& src, VkMat& dst, const Option& opt, bool flatten = true); + + int submit_and_wait(); + + int reset(); + + uint64_t pending_upload_total() const; + +protected: + const VulkanDevice* vkdev; + +private: + VkTransferPrivate* const d; +}; + +} // namespace ncnn + +#endif // NCNN_VULKAN + +#endif // NCNN_COMMAND_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/cpu.h b/app/libs/ncnn/arm64-v8a/include/ncnn/cpu.h new file mode 100644 index 0000000..cbf4171 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/cpu.h @@ -0,0 +1,177 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_CPU_H +#define NCNN_CPU_H + +#include + +#if defined _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif +#if defined __ANDROID__ || defined __linux__ +#include // cpu_set_t +#endif + +#include "platform.h" + +namespace ncnn { + +class NCNN_EXPORT CpuSet +{ +public: + CpuSet(); + void enable(int cpu); + void disable(int cpu); + void disable_all(); + bool is_enabled(int cpu) const; + int num_enabled() const; + +public: +#if defined _WIN32 + ULONG_PTR mask; +#endif +#if defined __ANDROID__ || defined __linux__ + cpu_set_t cpu_set; +#endif +#if __APPLE__ + unsigned int policy; +#endif +}; + +// test optional cpu features +// edsp = armv7 edsp +NCNN_EXPORT int cpu_support_arm_edsp(); +// neon = armv7 neon or aarch64 asimd +NCNN_EXPORT int cpu_support_arm_neon(); +// vfpv4 = armv7 fp16 + fma +NCNN_EXPORT int cpu_support_arm_vfpv4(); +// asimdhp = aarch64 asimd half precision +NCNN_EXPORT int cpu_support_arm_asimdhp(); +// cpuid = aarch64 cpuid info +NCNN_EXPORT int cpu_support_arm_cpuid(); +// asimddp = aarch64 asimd dot product +NCNN_EXPORT int cpu_support_arm_asimddp(); +// asimdfhm = aarch64 asimd fhm +NCNN_EXPORT int cpu_support_arm_asimdfhm(); +// bf16 = aarch64 bf16 +NCNN_EXPORT int cpu_support_arm_bf16(); +// i8mm = aarch64 i8mm +NCNN_EXPORT int cpu_support_arm_i8mm(); +// sve = aarch64 sve +NCNN_EXPORT int cpu_support_arm_sve(); +// sve2 = aarch64 sve2 +NCNN_EXPORT int cpu_support_arm_sve2(); +// svebf16 = aarch64 svebf16 +NCNN_EXPORT int cpu_support_arm_svebf16(); +// svei8mm = aarch64 svei8mm +NCNN_EXPORT int cpu_support_arm_svei8mm(); +// svef32mm = aarch64 svef32mm +NCNN_EXPORT int cpu_support_arm_svef32mm(); + +// avx = x86 avx +NCNN_EXPORT int cpu_support_x86_avx(); +// fma = x86 fma +NCNN_EXPORT int cpu_support_x86_fma(); +// xop = x86 xop +NCNN_EXPORT int cpu_support_x86_xop(); +// f16c = x86 f16c +NCNN_EXPORT int cpu_support_x86_f16c(); +// avx2 = x86 avx2 + fma + f16c +NCNN_EXPORT int cpu_support_x86_avx2(); +// avx_vnni = x86 avx vnni +NCNN_EXPORT int cpu_support_x86_avx_vnni(); +// avx_vnni_int8 = x86 avx vnni int8 +NCNN_EXPORT int cpu_support_x86_avx_vnni_int8(); +// avx_vnni_int16 = x86 avx vnni int16 +NCNN_EXPORT int cpu_support_x86_avx_vnni_int16(); +// avx_ne_convert = x86 avx ne convert +NCNN_EXPORT int cpu_support_x86_avx_ne_convert(); +// avx512 = x86 avx512f + avx512cd + avx512bw + avx512dq + avx512vl +NCNN_EXPORT int cpu_support_x86_avx512(); +// avx512_vnni = x86 avx512 vnni +NCNN_EXPORT int cpu_support_x86_avx512_vnni(); +// avx512_bf16 = x86 avx512 bf16 +NCNN_EXPORT int cpu_support_x86_avx512_bf16(); +// avx512_fp16 = x86 avx512 fp16 +NCNN_EXPORT int cpu_support_x86_avx512_fp16(); + +// lsx = loongarch lsx +NCNN_EXPORT int cpu_support_loongarch_lsx(); +// lasx = loongarch lasx +NCNN_EXPORT int cpu_support_loongarch_lasx(); + +// msa = mips mas +NCNN_EXPORT int cpu_support_mips_msa(); +// mmi = loongson mmi +NCNN_EXPORT int cpu_support_loongson_mmi(); + +// v = riscv vector +NCNN_EXPORT int cpu_support_riscv_v(); +// zfh = riscv half-precision float +NCNN_EXPORT int cpu_support_riscv_zfh(); +// zvfh = riscv vector half-precision float +NCNN_EXPORT int cpu_support_riscv_zvfh(); +// xtheadvector = riscv xtheadvector +NCNN_EXPORT int cpu_support_riscv_xtheadvector(); +// vlenb = riscv vector length in bytes +NCNN_EXPORT int cpu_riscv_vlenb(); + +// cpu info +NCNN_EXPORT int get_cpu_count(); +NCNN_EXPORT int get_little_cpu_count(); +NCNN_EXPORT int get_big_cpu_count(); + +NCNN_EXPORT int get_physical_cpu_count(); +NCNN_EXPORT int get_physical_little_cpu_count(); +NCNN_EXPORT int get_physical_big_cpu_count(); + +// cpu l2 varies from 64k to 1M, but l3 can be zero +NCNN_EXPORT int get_cpu_level2_cache_size(); +NCNN_EXPORT int get_cpu_level3_cache_size(); + +// bind all threads on little clusters if powersave enabled +// affects HMP arch cpu like ARM big.LITTLE +// only implemented on android at the moment +// switching powersave is expensive and not thread-safe +// 0 = all cores enabled(default) +// 1 = only little clusters enabled +// 2 = only big clusters enabled +// return 0 if success for setter function +NCNN_EXPORT int get_cpu_powersave(); +NCNN_EXPORT int set_cpu_powersave(int powersave); + +// convenient wrapper +NCNN_EXPORT const CpuSet& get_cpu_thread_affinity_mask(int powersave); + +// set explicit thread affinity +NCNN_EXPORT int set_cpu_thread_affinity(const CpuSet& thread_affinity_mask); + +// runtime thread affinity info +NCNN_EXPORT int is_current_thread_running_on_a53_a55(); + +// misc function wrapper for openmp routines +NCNN_EXPORT int get_omp_num_threads(); +NCNN_EXPORT void set_omp_num_threads(int num_threads); + +NCNN_EXPORT int get_omp_dynamic(); +NCNN_EXPORT void set_omp_dynamic(int dynamic); + +NCNN_EXPORT int get_omp_thread_num(); + +NCNN_EXPORT int get_kmp_blocktime(); +NCNN_EXPORT void set_kmp_blocktime(int time_ms); + +// need to flush denormals on Intel Chipset. +// Other architectures such as ARM can be added as needed. +// 0 = DAZ OFF, FTZ OFF +// 1 = DAZ ON , FTZ OFF +// 2 = DAZ OFF, FTZ ON +// 3 = DAZ ON, FTZ ON +NCNN_EXPORT int get_flush_denormals(); +NCNN_EXPORT int set_flush_denormals(int flush_denormals); + +} // namespace ncnn + +#endif // NCNN_CPU_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/datareader.h b/app/libs/ncnn/arm64-v8a/include/ncnn/datareader.h new file mode 100644 index 0000000..0161d79 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/datareader.h @@ -0,0 +1,111 @@ +// Copyright 2019 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_DATAREADER_H +#define NCNN_DATAREADER_H + +#include "platform.h" +#if NCNN_STDIO +#include +#endif + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 +#include +#endif +#endif // NCNN_PLATFORM_API + +namespace ncnn { + +// data read wrapper +class NCNN_EXPORT DataReader +{ +public: + DataReader(); + virtual ~DataReader(); + +#if NCNN_STRING + // parse plain param text + // return 1 if scan success + virtual int scan(const char* format, void* p) const; +#endif // NCNN_STRING + + // read binary param and model data + // return bytes read + virtual size_t read(void* buf, size_t size) const; + + // get model data reference + // return bytes referenced + virtual size_t reference(size_t size, const void** buf) const; +}; + +#if NCNN_STDIO +class DataReaderFromStdioPrivate; +class NCNN_EXPORT DataReaderFromStdio : public DataReader +{ +public: + explicit DataReaderFromStdio(FILE* fp); + virtual ~DataReaderFromStdio(); + +#if NCNN_STRING + virtual int scan(const char* format, void* p) const; +#endif // NCNN_STRING + virtual size_t read(void* buf, size_t size) const; + +private: + DataReaderFromStdio(const DataReaderFromStdio&); + DataReaderFromStdio& operator=(const DataReaderFromStdio&); + +private: + DataReaderFromStdioPrivate* const d; +}; +#endif // NCNN_STDIO + +class DataReaderFromMemoryPrivate; +class NCNN_EXPORT DataReaderFromMemory : public DataReader +{ +public: + explicit DataReaderFromMemory(const unsigned char*& mem); + virtual ~DataReaderFromMemory(); + +#if NCNN_STRING + virtual int scan(const char* format, void* p) const; +#endif // NCNN_STRING + virtual size_t read(void* buf, size_t size) const; + virtual size_t reference(size_t size, const void** buf) const; + +private: + DataReaderFromMemory(const DataReaderFromMemory&); + DataReaderFromMemory& operator=(const DataReaderFromMemory&); + +private: + DataReaderFromMemoryPrivate* const d; +}; + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 +class DataReaderFromAndroidAssetPrivate; +class NCNN_EXPORT DataReaderFromAndroidAsset : public DataReader +{ +public: + explicit DataReaderFromAndroidAsset(AAsset* asset); + virtual ~DataReaderFromAndroidAsset(); + +#if NCNN_STRING + virtual int scan(const char* format, void* p) const; +#endif // NCNN_STRING + virtual size_t read(void* buf, size_t size) const; + +private: + DataReaderFromAndroidAsset(const DataReaderFromAndroidAsset&); + DataReaderFromAndroidAsset& operator=(const DataReaderFromAndroidAsset&); + +private: + DataReaderFromAndroidAssetPrivate* const d; +}; +#endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API + +} // namespace ncnn + +#endif // NCNN_DATAREADER_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/expression.h b/app/libs/ncnn/arm64-v8a/include/ncnn/expression.h new file mode 100644 index 0000000..194c739 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/expression.h @@ -0,0 +1,17 @@ +// Copyright 2025 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#include "mat.h" + +namespace ncnn { + +// count how many blobs are referenced inside expression +NCNN_EXPORT int count_expression_blobs(const std::string& expr); + +// resolve reshape shape from expression and input blobs +// resolve slice indices(starts, ends) from expression and input blobs +// see docs/developer-guide/expression.md +// return 0 if success +NCNN_EXPORT int eval_list_expression(const std::string& expr, const std::vector& blobs, std::vector& outlist); + +} // namespace ncnn diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/gpu.h b/app/libs/ncnn/arm64-v8a/include/ncnn/gpu.h new file mode 100644 index 0000000..aec8b03 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/gpu.h @@ -0,0 +1,585 @@ +// Copyright 2018 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_GPU_H +#define NCNN_GPU_H + +#include "platform.h" + +#if NCNN_VULKAN + +#include "mat.h" + +namespace ncnn { + +// instance + +// Create VkInstance and initialize some objects that need to be calculated by GPU +// Creates a VkInstance object, Checks the extended attributes supported by the Vulkan instance concerned, +// Initializes, and creates Vulkan validation layers (if ENABLE_VALIDATION_LAYER is enabled), +// Iterates over all supported physical devices, etc. +NCNN_EXPORT int create_gpu_instance(const char* driver_path = 0); + +// Get global VkInstance variable +// Must be called after create_gpu_instance() and before destroy_gpu_instance() +NCNN_EXPORT VkInstance get_gpu_instance(); + +// Destroy VkInstance object and free the memory of the associated object +// Usually called in the destructor of the main program exit +// The function will internally ensure that all vulkan devices are idle before proceeding with destruction. +NCNN_EXPORT void destroy_gpu_instance(); + +// vulkan core +extern PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers; +extern PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets; +extern PFN_vkAllocateMemory vkAllocateMemory; +extern PFN_vkBeginCommandBuffer vkBeginCommandBuffer; +extern PFN_vkBindBufferMemory vkBindBufferMemory; +extern PFN_vkBindImageMemory vkBindImageMemory; +extern PFN_vkCmdBeginQuery vkCmdBeginQuery; +extern PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets; +extern PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer; +extern PFN_vkCmdBindPipeline vkCmdBindPipeline; +extern PFN_vkCmdCopyBuffer vkCmdCopyBuffer; +extern PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage; +extern PFN_vkCmdCopyImage vkCmdCopyImage; +extern PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer; +extern PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults; +extern PFN_vkCmdDispatch vkCmdDispatch; +extern PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect; +extern PFN_vkCmdEndQuery vkCmdEndQuery; +extern PFN_vkCmdExecuteCommands vkCmdExecuteCommands; +extern PFN_vkCmdFillBuffer vkCmdFillBuffer; +extern PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier; +extern PFN_vkCmdPushConstants vkCmdPushConstants; +extern PFN_vkCmdResetQueryPool vkCmdResetQueryPool; +extern PFN_vkCmdResolveImage vkCmdResolveImage; +extern PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer; +extern PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp; +extern PFN_vkCreateBuffer vkCreateBuffer; +extern PFN_vkCreateBufferView vkCreateBufferView; +extern PFN_vkCreateCommandPool vkCreateCommandPool; +extern PFN_vkCreateComputePipelines vkCreateComputePipelines; +extern PFN_vkCreateDescriptorPool vkCreateDescriptorPool; +extern PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout; +extern PFN_vkCreateDevice vkCreateDevice; +extern PFN_vkCreateFence vkCreateFence; +extern PFN_vkCreateImage vkCreateImage; +extern PFN_vkCreateImageView vkCreateImageView; +extern PFN_vkCreatePipelineCache vkCreatePipelineCache; +extern PFN_vkCreatePipelineLayout vkCreatePipelineLayout; +extern PFN_vkCreateQueryPool vkCreateQueryPool; +extern PFN_vkCreateSampler vkCreateSampler; +extern PFN_vkCreateSemaphore vkCreateSemaphore; +extern PFN_vkCreateShaderModule vkCreateShaderModule; +extern PFN_vkDestroyBuffer vkDestroyBuffer; +extern PFN_vkDestroyBufferView vkDestroyBufferView; +extern PFN_vkDestroyCommandPool vkDestroyCommandPool; +extern PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool; +extern PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout; +extern PFN_vkDestroyDevice vkDestroyDevice; +extern PFN_vkDestroyFence vkDestroyFence; +extern PFN_vkDestroyImage vkDestroyImage; +extern PFN_vkDestroyImageView vkDestroyImageView; +extern PFN_vkDestroyInstance vkDestroyInstance; +extern PFN_vkDestroyPipeline vkDestroyPipeline; +extern PFN_vkDestroyPipelineCache vkDestroyPipelineCache; +extern PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout; +extern PFN_vkDestroyQueryPool vkDestroyQueryPool; +extern PFN_vkDestroySampler vkDestroySampler; +extern PFN_vkDestroySemaphore vkDestroySemaphore; +extern PFN_vkDestroyShaderModule vkDestroyShaderModule; +extern PFN_vkDeviceWaitIdle vkDeviceWaitIdle; +extern PFN_vkEndCommandBuffer vkEndCommandBuffer; +extern PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties; +extern PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties; +extern PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices; +extern PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges; +extern PFN_vkFreeCommandBuffers vkFreeCommandBuffers; +extern PFN_vkFreeDescriptorSets vkFreeDescriptorSets; +extern PFN_vkFreeMemory vkFreeMemory; +extern PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements; +extern PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment; +extern PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr; +extern PFN_vkGetDeviceQueue vkGetDeviceQueue; +extern PFN_vkGetFenceStatus vkGetFenceStatus; +extern PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements; +extern PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout; +extern PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures; +extern PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties; +extern PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties; +extern PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties; +extern PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; +extern PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties; +extern PFN_vkGetPipelineCacheData vkGetPipelineCacheData; +extern PFN_vkGetQueryPoolResults vkGetQueryPoolResults; +extern PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges; +extern PFN_vkMapMemory vkMapMemory; +extern PFN_vkMergePipelineCaches vkMergePipelineCaches; +extern PFN_vkQueueSubmit vkQueueSubmit; +extern PFN_vkQueueWaitIdle vkQueueWaitIdle; +extern PFN_vkResetCommandBuffer vkResetCommandBuffer; +extern PFN_vkResetCommandPool vkResetCommandPool; +extern PFN_vkResetDescriptorPool vkResetDescriptorPool; +extern PFN_vkResetFences vkResetFences; +extern PFN_vkUnmapMemory vkUnmapMemory; +extern PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets; +extern PFN_vkWaitForFences vkWaitForFences; + +// instance extension capability +extern int support_VK_KHR_external_memory_capabilities; +extern int support_VK_KHR_device_group_creation; +extern int support_VK_KHR_get_physical_device_properties2; +extern int support_VK_KHR_get_surface_capabilities2; +extern int support_VK_KHR_surface; +extern int support_VK_EXT_debug_utils; +extern int support_VK_EXT_validation_features; +extern int support_VK_EXT_validation_flags; +#if __ANDROID_API__ >= 26 +extern int support_VK_KHR_android_surface; +#endif // __ANDROID_API__ >= 26 + +// VK_KHR_cooperative_matrix +extern PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR; + +// VK_KHR_external_memory_capabilities +extern PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR vkGetPhysicalDeviceExternalBufferPropertiesKHR; + +// VK_KHR_get_physical_device_properties2 +extern PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; +extern PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR; +extern PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR; +extern PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2KHR; +extern PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR; +extern PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR; + +// VK_KHR_get_surface_capabilities2 +extern PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR; +extern PFN_vkGetPhysicalDeviceSurfaceFormats2KHR vkGetPhysicalDeviceSurfaceFormats2KHR; + +// VK_KHR_surface +extern PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR; +extern PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR; +extern PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR; +extern PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR; +extern PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR; + +#if __ANDROID_API__ >= 26 +// VK_KHR_android_surface +extern PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR; +#endif // __ANDROID_API__ >= 26 + +// VK_NV_cooperative_matrix +extern PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV vkGetPhysicalDeviceCooperativeMatrixPropertiesNV; + +// VK_NV_cooperative_matrix2 +extern PFN_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV; + +// VK_NV_cooperative_vector +extern PFN_vkGetPhysicalDeviceCooperativeVectorPropertiesNV vkGetPhysicalDeviceCooperativeVectorPropertiesNV; + +// get info +NCNN_EXPORT int get_gpu_count(); +NCNN_EXPORT int get_default_gpu_index(); + +class GpuInfoPrivate; +class NCNN_EXPORT GpuInfo +{ +public: + explicit GpuInfo(); + virtual ~GpuInfo(); + + int device_index() const; + + // vulkan physical device + VkPhysicalDevice physicalDevice() const; + VkPhysicalDevice physical_device() const; // api compatibility + + // features + const VkPhysicalDeviceFeatures& physicalDevicefeatures() const; + + // properties + const VkPhysicalDeviceProperties& physicalDeviceProperties() const; + + // memory properties + const VkPhysicalDeviceMemoryProperties& physicalDeviceMemoryProperties() const; + const VkPhysicalDeviceMemoryProperties& physical_device_memory_properties() const; // api compatibility + + // extension properties + const std::vector& deviceExtensionProperties() const; + + // info + uint32_t api_version() const; + uint32_t driver_version() const; + uint32_t vendor_id() const; + uint32_t device_id() const; + const char* device_name() const; + uint8_t* pipeline_cache_uuid() const; + + // driver properties + uint32_t driver_id() const; + const char* driver_name() const; + + // 0 = discrete gpu + // 1 = integrated gpu + // 2 = virtual gpu + // 3 = cpu + int type() const; + + // performance score roughly evaluated based on parameters such as device type, + // supported extensions, video memory size etc. + // high-end device scores over 75 + // low-end device scores below 10 + uint32_t rough_score() const; + + // hardware limit + uint32_t max_shared_memory_size() const; + uint32_t max_workgroup_count_x() const; + uint32_t max_workgroup_count_y() const; + uint32_t max_workgroup_count_z() const; + uint32_t max_workgroup_invocations() const; + uint32_t max_workgroup_size_x() const; + uint32_t max_workgroup_size_y() const; + uint32_t max_workgroup_size_z() const; + size_t memory_map_alignment() const; + size_t buffer_offset_alignment() const; + size_t non_coherent_atom_size() const; + size_t buffer_image_granularity() const; + uint32_t max_image_dimension_1d() const; + uint32_t max_image_dimension_2d() const; + uint32_t max_image_dimension_3d() const; + float timestamp_period() const; + + // runtime + uint32_t compute_queue_family_index() const; + uint32_t transfer_queue_family_index() const; + + uint32_t compute_queue_count() const; + uint32_t transfer_queue_count() const; + + // property + bool unified_compute_transfer_queue() const; + bool resizable_bar_enabled() const; + + // subgroup + uint32_t subgroup_size() const; + uint32_t min_subgroup_size() const; + uint32_t max_subgroup_size() const; + uint32_t max_compute_workgroup_subgroups() const; + bool support_subgroup_size_control() const; + bool support_compute_full_subgroups() const; + uint32_t support_subgroup_ops() const; + + // bug is not feature + bool bug_storage_buffer_no_l1() const; + bool bug_corrupted_online_pipeline_cache() const; + bool bug_buffer_image_load_zero() const; + + // but sometimes bug is a feature + bool bug_implicit_fp16_arithmetic() const; + + // fp16 and int8 feature + bool support_fp16_packed() const; + bool support_fp16_storage() const; + bool support_fp16_uniform() const; + bool support_fp16_arithmetic() const; + bool support_int8_packed() const; + bool support_int8_storage() const; + bool support_int8_uniform() const; + bool support_int8_arithmetic() const; + + // bf16 feature + bool support_bf16_packed() const; + bool support_bf16_storage() const; // bf16s implies bf16u + + // r16f and r8s format in storage image + bool support_fp16_image() const; + bool support_int8_image() const; + + // shader float controls2 + bool support_fp_fast_math() const; + + // ycbcr conversion feature + bool support_ycbcr_conversion() const; + + // cooperative matrix feature + bool support_cooperative_matrix() const; + bool support_cooperative_matrix_8_8_16() const; + bool support_cooperative_matrix_16_8_8() const; + bool support_cooperative_matrix_16_8_16() const; + bool support_cooperative_matrix_16_16_16() const; + + // bf16 cooperative matrix feature + bool support_bf16_cooperative_matrix() const; + + // extension capability + int support_VK_KHR_8bit_storage() const; + int support_VK_KHR_16bit_storage() const; + int support_VK_KHR_bind_memory2() const; + int support_VK_KHR_buffer_device_address() const; + int support_VK_KHR_create_renderpass2() const; + int support_VK_KHR_cooperative_matrix() const; + int support_VK_KHR_dedicated_allocation() const; + int support_VK_KHR_descriptor_update_template() const; + int support_VK_KHR_device_group() const; + int support_VK_KHR_driver_properties() const; + int support_VK_KHR_external_memory() const; + int support_VK_KHR_get_memory_requirements2() const; + int support_VK_KHR_maintenance1() const; + int support_VK_KHR_maintenance2() const; + int support_VK_KHR_maintenance3() const; + int support_VK_KHR_multiview() const; + int support_VK_KHR_portability_subset() const; + int support_VK_KHR_push_descriptor() const; + int support_VK_KHR_robustness2() const; + int support_VK_KHR_sampler_ycbcr_conversion() const; + int support_VK_KHR_shader_bfloat16() const; + int support_VK_KHR_shader_float16_int8() const; + int support_VK_KHR_shader_float_controls() const; + int support_VK_KHR_shader_float_controls2() const; + int support_VK_KHR_shader_integer_dot_product() const; + int support_VK_KHR_shader_non_semantic_info() const; + int support_VK_KHR_shader_subgroup_extended_types() const; + int support_VK_KHR_shader_subgroup_rotate() const; + int support_VK_KHR_storage_buffer_storage_class() const; + int support_VK_KHR_swapchain() const; + int support_VK_KHR_vulkan_memory_model() const; + int support_VK_KHR_zero_initialize_workgroup_memory() const; + int support_VK_EXT_buffer_device_address() const; + int support_VK_EXT_descriptor_indexing() const; + int support_VK_EXT_external_memory_host() const; + int support_VK_EXT_memory_budget() const; + int support_VK_EXT_memory_priority() const; + int support_VK_EXT_queue_family_foreign() const; + int support_VK_EXT_robustness2() const; + int support_VK_EXT_shader_atomic_float() const; + int support_VK_EXT_shader_atomic_float2() const; + int support_VK_EXT_shader_float8() const; + int support_VK_EXT_subgroup_size_control() const; + int support_VK_AMD_device_coherent_memory() const; +#if __ANDROID_API__ >= 26 + int support_VK_ANDROID_external_memory_android_hardware_buffer() const; +#endif // __ANDROID_API__ >= 26 + int support_VK_NV_cooperative_matrix() const; + int support_VK_NV_cooperative_matrix2() const; + int support_VK_NV_cooperative_vector() const; + + // extension features + const void* queryExtensionFeatures() const; + const VkPhysicalDevice8BitStorageFeaturesKHR& query8BitStorageFeatures() const; + const VkPhysicalDevice16BitStorageFeaturesKHR& query16BitStorageFeatures() const; + const VkPhysicalDeviceFloat16Int8FeaturesKHR& queryFloat16Int8Features() const; + const VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR& querySamplerYcbcrConversionFeatures() const; + const VkPhysicalDeviceCooperativeMatrixFeaturesKHR& queryCooperativeMatrixFeatures() const; + const VkPhysicalDeviceCooperativeMatrixFeaturesNV& queryCooperativeMatrixFeaturesNV() const; + const VkPhysicalDeviceCooperativeMatrix2FeaturesNV& queryCooperativeMatrix2FeaturesNV() const; + const VkPhysicalDeviceCooperativeVectorFeaturesNV& queryCooperativeVectorFeaturesNV() const; + const VkPhysicalDeviceRobustness2FeaturesKHR& queryRobustness2Features() const; + const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT& querySubgroupSizeControlFeatures() const; + const VkPhysicalDeviceShaderBfloat16FeaturesKHR& queryShaderBfloat16Features() const; + const VkPhysicalDeviceShaderFloat8FeaturesEXT& queryShaderFloat8Features() const; + const VkPhysicalDeviceShaderFloatControls2FeaturesKHR& queryShaderFloatControls2Features() const; + const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR& queryShaderIntegerDotProductFeatures() const; + const VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR& queryShaderSubgroupRotateFeatures() const; + const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT& queryShaderAtomicFloatFeatures() const; + const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT& queryShaderAtomicFloat2Features() const; + const VkPhysicalDeviceVulkanMemoryModelFeaturesKHR& queryVulkanMemoryModelFeatures() const; + + // extension properties + const void* queryExtensionProperties() const; + const VkPhysicalDeviceCooperativeMatrix2PropertiesNV& queryCooperativeMatrix2PropertiesNV() const; + const VkPhysicalDeviceCooperativeVectorPropertiesNV& queryCooperativeVectorPropertiesNV() const; + const VkPhysicalDeviceDriverPropertiesKHR& queryDriverProperties() const; + const VkPhysicalDeviceFloatControlsPropertiesKHR& queryFloatControlsProperties() const; + const VkPhysicalDeviceRobustness2PropertiesKHR& queryRobustness2Properties() const; + const VkPhysicalDeviceShaderIntegerDotProductProperties& queryShaderIntegerDotProductProperties() const; + const VkPhysicalDeviceSubgroupProperties& querySubgroupProperties() const; + const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT& querySubgroupSizeControlProperties() const; + const VkPhysicalDeviceExternalMemoryHostPropertiesEXT& queryExternalMemoryHostProperties() const; + + // extension sub properties + const std::vector& queryCooperativeMatrixSubProperties() const; + const std::vector& queryCooperativeMatrixSubPropertiesNV() const; + const std::vector& queryCooperativeMatrixFlexibleDimensionsSubPropertiesNV() const; + const std::vector& queryCooperativeVectorSubPropertiesNV() const; + + // some utility functions + void get_optimal_cooperative_matrix_mnk(int M, int N, int K, VkComponentTypeKHR type, VkComponentTypeKHR acctype, VkScopeKHR scope, int& coopmat_M, int& coopmat_N, int& coopmat_K, int& coopmat_subgroup_size) const; + +private: + GpuInfo(const GpuInfo&); + GpuInfo& operator=(const GpuInfo&); + +private: + friend int create_gpu_instance(const char* driver_path); + GpuInfoPrivate* const d; +}; + +NCNN_EXPORT const GpuInfo& get_gpu_info(int device_index = get_default_gpu_index()); + +class VkAllocator; +class VkCompute; +class Option; +class PipelineCache; +class VulkanDevicePrivate; +class NCNN_EXPORT VulkanDevice +{ +public: + VulkanDevice(int device_index = get_default_gpu_index()); + ~VulkanDevice(); + + const GpuInfo& info; + + VkDevice vkdevice() const; + bool is_valid() const; + + VkShaderModule compile_shader_module(const uint32_t* spv_data, size_t spv_data_size) const; + + // with fixed workgroup size + VkShaderModule compile_shader_module(const uint32_t* spv_data, size_t spv_data_size, uint32_t local_size_x, uint32_t local_size_y, uint32_t local_size_z) const; + + // helper for creating pipeline + int create_descriptorset_layout(int binding_count, const int* binding_types, VkDescriptorSetLayout* descriptorset_layout) const; + int create_pipeline_layout(int push_constant_count, VkDescriptorSetLayout descriptorset_layout, VkPipelineLayout* pipeline_layout) const; + int create_pipeline(VkShaderModule shader_module, VkPipelineLayout pipeline_layout, const std::vector& specializations, uint32_t subgroup_size, VkPipeline* pipeline) const; + int create_pipeline(VkShaderModule shader_module, VkPipelineLayout pipeline_layout, const std::vector& specializations, uint32_t subgroup_size, VkPipelineCache pipeline_cache, VkPipeline* pipeline) const; + int create_descriptor_update_template(int binding_count, const int* binding_types, VkDescriptorSetLayout descriptorset_layout, VkPipelineLayout pipeline_layout, VkDescriptorUpdateTemplateKHR* descriptor_update_template) const; + + uint32_t find_memory_index(uint32_t memory_type_bits, VkFlags required, VkFlags preferred, VkFlags preferred_not) const; + bool is_mappable(uint32_t memory_type_index) const; + bool is_coherent(uint32_t memory_type_index) const; + bool is_device_local(uint32_t memory_type_index) const; + + VkQueue acquire_queue(uint32_t queue_family_index) const; + void reclaim_queue(uint32_t queue_family_index, VkQueue queue) const; + + // allocator on this device + VkAllocator* acquire_blob_allocator() const; + void reclaim_blob_allocator(VkAllocator* allocator) const; + + VkAllocator* acquire_staging_allocator() const; + void reclaim_staging_allocator(VkAllocator* allocator) const; + + // immutable sampler for texelfetch + const VkSampler* immutable_texelfetch_sampler() const; + + // dummy buffer image + VkMat get_dummy_buffer() const; + VkImageMat get_dummy_image() const; + VkImageMat get_dummy_image_readonly() const; + + // pipeline cache on this device + const PipelineCache* get_pipeline_cache() const; + + // test image allocation + bool shape_support_image_storage(const Mat& shape) const; + + // current gpu heap memory budget in MB + uint32_t get_heap_budget() const; + + // utility operator + void convert_packing(const VkMat& src, VkMat& dst, int dst_elempack, VkCompute& cmd, const Option& opt) const; + // cast_type_to 0=auto(same as src) 1=fp32 2=fp16 3=int32 4=int8 5=bf16 + void convert_packing(const VkMat& src, VkMat& dst, int dst_elempack, int cast_type_to, VkCompute& cmd, const Option& opt) const; + + // VK_KHR_bind_memory2 + PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR; + PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR; + + // VK_KHR_buffer_device_address + PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR; + PFN_vkGetBufferOpaqueCaptureAddressKHR vkGetBufferOpaqueCaptureAddressKHR; + PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR vkGetDeviceMemoryOpaqueCaptureAddressKHR; + + // VK_KHR_descriptor_update_template + PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR; + PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR; + PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR; + + // VK_KHR_get_memory_requirements2 + PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR; + PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR; + + // VK_KHR_maintenance1 + PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR; + + // VK_KHR_maintenance3 + PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR; + + // VK_KHR_push_descriptor + PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR; + PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR; + + // VK_KHR_sampler_ycbcr_conversion + PFN_vkCreateSamplerYcbcrConversionKHR vkCreateSamplerYcbcrConversionKHR; + PFN_vkDestroySamplerYcbcrConversionKHR vkDestroySamplerYcbcrConversionKHR; + + // VK_KHR_swapchain + PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR; + PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR; + PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR; + PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR; + PFN_vkQueuePresentKHR vkQueuePresentKHR; + + // VK_EXT_buffer_device_address + PFN_vkGetBufferDeviceAddressEXT vkGetBufferDeviceAddressEXT; + + // VK_EXT_external_memory_host + PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT; + +#if __ANDROID_API__ >= 26 + // VK_ANDROID_external_memory_android_hardware_buffer + PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID; + PFN_vkGetMemoryAndroidHardwareBufferANDROID vkGetMemoryAndroidHardwareBufferANDROID; +#endif // __ANDROID_API__ >= 26 + + // VK_NV_cooperative_vector + PFN_vkCmdConvertCooperativeVectorMatrixNV vkCmdConvertCooperativeVectorMatrixNV; + PFN_vkConvertCooperativeVectorMatrixNV vkConvertCooperativeVectorMatrixNV; + +protected: + // device extension + int init_device_extension(); + +private: + VulkanDevice(const VulkanDevice&); + VulkanDevice& operator=(const VulkanDevice&); + +private: + VulkanDevicePrivate* const d; +}; + +NCNN_EXPORT VulkanDevice* get_gpu_device(int device_index = get_default_gpu_index()); + +// online spirv compilation +NCNN_EXPORT int compile_spirv_module(const char* comp_string, const Option& opt, std::vector& spirv); +NCNN_EXPORT int compile_spirv_module(const char* comp_data, int comp_data_size, const Option& opt, std::vector& spirv); +NCNN_EXPORT int compile_spirv_module(int shader_type_index, const Option& opt, std::vector& spirv); + +// info from spirv +class NCNN_EXPORT ShaderInfo +{ +public: + int specialization_count; + int binding_count; + int push_constant_count; + + // 0 = null + // 1 = storage buffer + // 2 = storage image + // 3 = combined image sampler + int binding_types[16]; // 16 is large enough I think ... + + int reserved_0; + int reserved_1; + int reserved_2; + int reserved_3; +}; + +NCNN_EXPORT int resolve_shader_info(const uint32_t* spv_data, size_t spv_data_size, ShaderInfo& shader_info); + +} // namespace ncnn + +#endif // NCNN_VULKAN + +#endif // NCNN_GPU_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/layer.h b/app/libs/ncnn/arm64-v8a/include/ncnn/layer.h new file mode 100644 index 0000000..9fa45d7 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/layer.h @@ -0,0 +1,212 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_LAYER_H +#define NCNN_LAYER_H + +#include "mat.h" +#include "modelbin.h" +#include "option.h" +#include "paramdict.h" +#include "platform.h" + +#if NCNN_VULKAN +#include "command.h" +#include "pipeline.h" +#endif // NCNN_VULKAN + +namespace ncnn { + +class NCNN_EXPORT Layer +{ +public: + // empty + Layer(); + // virtual destructor + virtual ~Layer(); + + // load layer specific parameter from parsed dict + // return 0 if success + virtual int load_param(const ParamDict& pd); + + // load layer specific weight data from model binary + // return 0 if success + virtual int load_model(const ModelBin& mb); + + // layer implementation specific setup + // return 0 if success + virtual int create_pipeline(const Option& opt); + + // layer implementation specific clean + // return 0 if success + virtual int destroy_pipeline(const Option& opt); + +public: + // one input and one output blob + bool one_blob_only; + + // support inplace inference + bool support_inplace; + + // support vulkan compute + bool support_vulkan; + + // accept input blob with packed storage + bool support_packing; + + // accept bf16 + bool support_bf16_storage; + + // accept fp16 + bool support_fp16_storage; + + // accept int8 + bool support_int8_storage; + + // shader tensor storage + bool support_tensor_storage; + + // vulkan accept input blob with packed storage + bool support_vulkan_packing; + + // accept input blob with any elempack + bool support_any_packing; + + // vulkan accept input blob with any elempack + bool support_vulkan_any_packing; + + bool support_reserved_1; + bool support_reserved_2; + bool support_reserved_3; + bool support_reserved_4; + bool support_reserved_5; + bool support_reserved_6; + bool support_reserved_7; + bool support_reserved_8; + bool support_reserved_9; + + // feature disabled set + int featmask; + +public: + // implement inference + // return 0 if success + virtual int forward(const std::vector& bottom_blobs, std::vector& top_blobs, const Option& opt) const; + virtual int forward(const Mat& bottom_blob, Mat& top_blob, const Option& opt) const; + + // implement inplace inference + // return 0 if success + virtual int forward_inplace(std::vector& bottom_top_blobs, const Option& opt) const; + virtual int forward_inplace(Mat& bottom_top_blob, const Option& opt) const; + +#if NCNN_VULKAN +public: + // upload weight blob from host to device + virtual int upload_model(VkTransfer& cmd, const Option& opt); + +public: + // implement inference + // return 0 if success + virtual int forward(const std::vector& bottom_blobs, std::vector& top_blobs, VkCompute& cmd, const Option& opt) const; + virtual int forward(const VkMat& bottom_blob, VkMat& top_blob, VkCompute& cmd, const Option& opt) const; + + // implement inplace inference + // return 0 if success + virtual int forward_inplace(std::vector& bottom_top_blobs, VkCompute& cmd, const Option& opt) const; + virtual int forward_inplace(VkMat& bottom_top_blob, VkCompute& cmd, const Option& opt) const; + +public: + // assigned immediately after creating this layer + const VulkanDevice* vkdev; +#endif // NCNN_VULKAN + +public: + // custom user data + void* userdata; + // layer type index + int typeindex; +#if NCNN_STRING + // layer type name + std::string type; + // layer name + std::string name; +#endif // NCNN_STRING + // blob index which this layer needs as input + std::vector bottoms; + // blob index which this layer produces as output + std::vector tops; + // shape hint + std::vector bottom_shapes; + std::vector top_shapes; +}; + +// layer factory function +typedef Layer* (*layer_creator_func)(void*); +typedef void (*layer_destroyer_func)(Layer*, void*); + +struct layer_registry_entry +{ +#if NCNN_STRING + // layer type name + const char* name; +#endif // NCNN_STRING + // layer factory entry + layer_creator_func creator; +}; + +struct custom_layer_registry_entry +{ +#if NCNN_STRING + // layer type name + const char* name; +#endif // NCNN_STRING + // layer factory entry + layer_creator_func creator; + layer_destroyer_func destroyer; + void* userdata; +}; + +struct overwrite_builtin_layer_registry_entry +{ + // layer type index + int typeindex; + // layer factory entry + layer_creator_func creator; + layer_destroyer_func destroyer; + void* userdata; +}; + +#if NCNN_STRING +// get layer type from type name +NCNN_EXPORT int layer_to_index(const char* type); +// create layer from type name +NCNN_EXPORT Layer* create_layer(const char* type); +NCNN_EXPORT Layer* create_layer_naive(const char* type); +NCNN_EXPORT Layer* create_layer_cpu(const char* type); +#if NCNN_VULKAN +NCNN_EXPORT Layer* create_layer_vulkan(const char* type); +#endif // NCNN_VULKAN +#endif // NCNN_STRING +// create layer from layer type +NCNN_EXPORT Layer* create_layer(int index); +NCNN_EXPORT Layer* create_layer_naive(int index); +NCNN_EXPORT Layer* create_layer_cpu(int index); +#if NCNN_VULKAN +NCNN_EXPORT Layer* create_layer_vulkan(int index); +#endif // NCNN_VULKAN + +#define DEFINE_LAYER_CREATOR(name) \ + ::ncnn::Layer* name##_layer_creator(void* /*userdata*/) \ + { \ + return new name; \ + } + +#define DEFINE_LAYER_DESTROYER(name) \ + void name##_layer_destroyer(::ncnn::Layer* layer, void* /*userdata*/) \ + { \ + delete layer; \ + } + +} // namespace ncnn + +#endif // NCNN_LAYER_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/layer_shader_type.h b/app/libs/ncnn/arm64-v8a/include/ncnn/layer_shader_type.h new file mode 100644 index 0000000..6e648eb --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/layer_shader_type.h @@ -0,0 +1,18 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_LAYER_SHADER_TYPE_H +#define NCNN_LAYER_SHADER_TYPE_H + +namespace ncnn { + +namespace LayerShaderType { +enum LayerShaderType +{ +#include "layer_shader_type_enum.h" +}; +} // namespace LayerShaderType + +} // namespace ncnn + +#endif // NCNN_LAYER_SHADER_TYPE_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/layer_shader_type_enum.h b/app/libs/ncnn/arm64-v8a/include/ncnn/layer_shader_type_enum.h new file mode 100644 index 0000000..7b389d8 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/layer_shader_type_enum.h @@ -0,0 +1,253 @@ +// Layer Shader Enum header +// +// This file is auto-generated by cmake, don't edit it. + +absval = 0, +batchnorm = 1, +batchnorm_pack4 = 2, +concat = 3, +concat_pack4 = 4, +concat_pack4to1 = 5, +convolution_1x1s1d1_cm = 6, +convolution_3x3s1d1_winograd23_transform_input = 7, +convolution_3x3s1d1_winograd23_transform_output = 8, +convolution_3x3s1d1_winograd43_transform_input = 9, +convolution_3x3s1d1_winograd43_transform_output = 10, +convolution_3x3s1d1_winograd_gemm = 11, +convolution_gemm_cm = 12, +convolution_pack1to4_3x3s1d1_winograd_gemm = 13, +convolution_pack4_3x3s1d1_winograd23_transform_input = 14, +convolution_pack4_3x3s1d1_winograd23_transform_output = 15, +convolution_pack4_3x3s1d1_winograd43_transform_input = 16, +convolution_pack4_3x3s1d1_winograd43_transform_output = 17, +convolution_pack4_3x3s1d1_winograd_gemm = 18, +convolution_pack4to1_3x3s1d1_winograd_gemm = 19, +convolution_packed = 20, +convolution_packed_1x1s1d1 = 21, +convolution_packed_gemm = 22, +convolution_winograd_gemm_cm = 23, +crop = 24, +crop_pack1to4 = 25, +crop_pack4 = 26, +crop_pack4to1 = 27, +deconvolution_col2im = 28, +deconvolution_gemm_cm = 29, +deconvolution_gemm_packed = 30, +deconvolution_pack4_col2im = 31, +deconvolution_packed = 32, +dropout = 33, +eltwise = 34, +elu = 35, +flatten = 36, +flatten_pack1to4 = 37, +flatten_pack4 = 38, +innerproduct = 39, +innerproduct_gemm = 40, +innerproduct_gemm_wp1to4 = 41, +innerproduct_gemm_wp4 = 42, +innerproduct_gemm_wp4to1 = 43, +innerproduct_pack1to4 = 44, +innerproduct_pack4 = 45, +innerproduct_pack4to1 = 46, +innerproduct_reduce_sum8 = 47, +innerproduct_reduce_sum8_pack4 = 48, +innerproduct_sum8 = 49, +innerproduct_sum8_pack1to4 = 50, +innerproduct_sum8_pack4 = 51, +innerproduct_sum8_pack4to1 = 52, +lrn_norm = 53, +lrn_norm_across_channel_pack4 = 54, +lrn_norm_within_channel_pack4 = 55, +lrn_square_pad = 56, +lrn_square_pad_across_channel_pack4 = 57, +lrn_square_pad_within_channel_pack4 = 58, +pooling = 59, +pooling_adaptive = 60, +pooling_adaptive_pack4 = 61, +pooling_global_reduce_max = 62, +pooling_global_reduce_max_first = 63, +pooling_global_reduce_max_first_pack4 = 64, +pooling_global_reduce_max_last = 65, +pooling_global_reduce_max_last_pack4 = 66, +pooling_global_reduce_max_pack4 = 67, +pooling_global_reduce_sum = 68, +pooling_global_reduce_sum_first = 69, +pooling_global_reduce_sum_first_pack4 = 70, +pooling_global_reduce_sum_last = 71, +pooling_global_reduce_sum_last_pack4 = 72, +pooling_global_reduce_sum_pack4 = 73, +pooling_pack4 = 74, +prelu = 75, +prelu_pack4 = 76, +reduction = 77, +relu = 78, +reshape = 79, +reshape_pack1to4 = 80, +reshape_pack4 = 81, +reshape_pack4to1 = 82, +scale = 83, +scale_pack4 = 84, +sigmoid = 85, +slice = 86, +slice_pack1to4 = 87, +slice_pack4 = 88, +softmax_div_sum = 89, +softmax_div_sum_pack4 = 90, +softmax_exp_sub_max = 91, +softmax_exp_sub_max_pack4 = 92, +softmax_reduce_max = 93, +softmax_reduce_max_pack4 = 94, +softmax_reduce_sum = 95, +softmax_reduce_sum_pack4 = 96, +tanh = 97, +binaryop = 98, +binaryop_broadcast = 99, +binaryop_broadcast_pack1to4 = 100, +binaryop_broadcast_pack4 = 101, +binaryop_pack4 = 102, +unaryop = 103, +convolutiondepthwise = 104, +convolutiondepthwise_group = 105, +convolutiondepthwise_group_pack1to4 = 106, +convolutiondepthwise_group_pack4 = 107, +convolutiondepthwise_group_pack4to1 = 108, +convolutiondepthwise_pack4 = 109, +padding = 110, +padding_3d = 111, +padding_3d_pack4 = 112, +padding_pack1to4 = 113, +padding_pack4 = 114, +padding_pack4to1 = 115, +normalize_coeffs = 116, +normalize_coeffs_pack4 = 117, +normalize_norm = 118, +normalize_norm_pack4 = 119, +normalize_reduce_sum4_fp16_to_fp32 = 120, +normalize_reduce_sum4_fp16_to_fp32_pack4 = 121, +normalize_reduce_sum4_fp32 = 122, +normalize_reduce_sum4_fp32_pack4 = 123, +permute = 124, +permute_pack1to4 = 125, +permute_pack4 = 126, +permute_pack4to1 = 127, +priorbox = 128, +priorbox_mxnet = 129, +interp = 130, +interp_bicubic = 131, +interp_bicubic_coeffs = 132, +interp_bicubic_pack4 = 133, +interp_pack4 = 134, +deconvolutiondepthwise = 135, +deconvolutiondepthwise_group = 136, +deconvolutiondepthwise_group_pack1to4 = 137, +deconvolutiondepthwise_group_pack4 = 138, +deconvolutiondepthwise_group_pack4to1 = 139, +deconvolutiondepthwise_pack4 = 140, +shufflechannel = 141, +shufflechannel_pack4 = 142, +instancenorm_coeffs = 143, +instancenorm_coeffs_pack4 = 144, +instancenorm_norm = 145, +instancenorm_norm_pack4 = 146, +instancenorm_reduce_mean = 147, +instancenorm_reduce_mean_pack4 = 148, +instancenorm_reduce_sum4_fp16_to_fp32 = 149, +instancenorm_reduce_sum4_fp16_to_fp32_pack4 = 150, +instancenorm_reduce_sum4_fp32 = 151, +instancenorm_reduce_sum4_fp32_pack4 = 152, +instancenorm_sub_mean_square = 153, +instancenorm_sub_mean_square_pack4 = 154, +clip = 155, +reorg = 156, +reorg_pack1to4 = 157, +reorg_pack4 = 158, +quantize = 159, +quantize_pack4 = 160, +dequantize = 161, +dequantize_pack4 = 162, +packing = 163, +packing_int8 = 164, +packing_pack1to4 = 165, +packing_pack1to4_int8 = 166, +packing_pack4to1 = 167, +packing_pack4to1_int8 = 168, +requantize = 169, +requantize_pack4 = 170, +cast_fp16_to_fp32 = 171, +cast_fp16_to_fp32_pack4 = 172, +cast_fp32_to_fp16 = 173, +cast_fp32_to_fp16_pack4 = 174, +hardsigmoid = 175, +selu = 176, +hardswish = 177, +pixelshuffle = 178, +pixelshuffle_pack4 = 179, +pixelshuffle_pack4to1 = 180, +deepcopy = 181, +deepcopy_pack4 = 182, +mish = 183, +swish = 184, +gemm = 185, +gemm_cm = 186, +gemm_sg = 187, +groupnorm_coeffs = 188, +groupnorm_coeffs_pack4 = 189, +groupnorm_norm = 190, +groupnorm_norm_pack4 = 191, +groupnorm_reduce_mean = 192, +groupnorm_reduce_mean_pack4 = 193, +groupnorm_reduce_sum4_fp16_to_fp32 = 194, +groupnorm_reduce_sum4_fp16_to_fp32_pack4 = 195, +groupnorm_reduce_sum4_fp32 = 196, +groupnorm_reduce_sum4_fp32_pack4 = 197, +groupnorm_sub_mean_square = 198, +groupnorm_sub_mean_square_pack4 = 199, +layernorm_coeffs = 200, +layernorm_coeffs_pack4 = 201, +layernorm_norm = 202, +layernorm_norm_pack4 = 203, +layernorm_reduce_mean = 204, +layernorm_reduce_mean_pack4 = 205, +layernorm_reduce_sum4_fp16_to_fp32 = 206, +layernorm_reduce_sum4_fp16_to_fp32_pack4 = 207, +layernorm_reduce_sum4_fp32 = 208, +layernorm_reduce_sum4_fp32_pack4 = 209, +layernorm_sub_mean_square = 210, +layernorm_sub_mean_square_pack4 = 211, +softplus = 212, +multiheadattention_qk_cross = 213, +multiheadattention_qk_cross_pack1to4 = 214, +multiheadattention_qk_cross_pack4 = 215, +multiheadattention_qk_cross_pack4to1 = 216, +multiheadattention_qkv_cross = 217, +multiheadattention_qkv_cross_pack1to4 = 218, +multiheadattention_qkv_cross_pack4 = 219, +multiheadattention_qkv_cross_pack4to1 = 220, +gelu = 221, +convolution1d_1x1s1d1_cm = 222, +convolution1d_gemm_cm = 223, +convolution1d_packed = 224, +convolution1d_packed_1x1s1d1 = 225, +convolution1d_packed_gemm = 226, +unfold_im2col = 227, +unfold_im2col_pack1to4 = 228, +unfold_im2col_pack4 = 229, +unfold_im2col_pack4to1 = 230, +erf = 231, +celu = 232, +shrink = 233, +rmsnorm_coeffs = 234, +rmsnorm_coeffs_pack4 = 235, +rmsnorm_norm = 236, +rmsnorm_norm_pack4 = 237, +rmsnorm_square = 238, +rmsnorm_square_pack4 = 239, +sdpa_cross = 240, +sdpa_cross_cm = 241, +sdpa_fa = 242, +sdpa_fa_cm = 243, +rotaryembed = 244, +rotaryembed_pack4 = 245, +convert_ycbcr = 246, +vulkan_activation = 247, + diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/layer_type.h b/app/libs/ncnn/arm64-v8a/include/ncnn/layer_type.h new file mode 100644 index 0000000..d65c591 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/layer_type.h @@ -0,0 +1,19 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_LAYER_TYPE_H +#define NCNN_LAYER_TYPE_H + +namespace ncnn { + +namespace LayerType { +enum LayerType +{ +#include "layer_type_enum.h" + CustomBit = (1 << 8), +}; +} // namespace LayerType + +} // namespace ncnn + +#endif // NCNN_LAYER_TYPE_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/layer_type_enum.h b/app/libs/ncnn/arm64-v8a/include/ncnn/layer_type_enum.h new file mode 100644 index 0000000..5e7a446 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/layer_type_enum.h @@ -0,0 +1,115 @@ +// Layer Type Enum header +// +// This file is auto-generated by cmake, don't edit it. + +AbsVal = 0, +ArgMax = 1, +BatchNorm = 2, +Bias = 3, +BNLL = 4, +Concat = 5, +Convolution = 6, +Crop = 7, +Deconvolution = 8, +Dropout = 9, +Eltwise = 10, +ELU = 11, +Embed = 12, +Exp = 13, +Flatten = 14, +InnerProduct = 15, +Input = 16, +Log = 17, +LRN = 18, +MemoryData = 19, +MVN = 20, +Pooling = 21, +Power = 22, +PReLU = 23, +Proposal = 24, +Reduction = 25, +ReLU = 26, +Reshape = 27, +ROIPooling = 28, +Scale = 29, +Sigmoid = 30, +Slice = 31, +Softmax = 32, +Split = 33, +SPP = 34, +TanH = 35, +Threshold = 36, +Tile = 37, +RNN = 38, +LSTM = 39, +BinaryOp = 40, +UnaryOp = 41, +ConvolutionDepthWise = 42, +Padding = 43, +Squeeze = 44, +ExpandDims = 45, +Normalize = 46, +Permute = 47, +PriorBox = 48, +DetectionOutput = 49, +Interp = 50, +DeconvolutionDepthWise = 51, +ShuffleChannel = 52, +InstanceNorm = 53, +Clip = 54, +Reorg = 55, +YoloDetectionOutput = 56, +Quantize = 57, +Dequantize = 58, +Yolov3DetectionOutput = 59, +PSROIPooling = 60, +ROIAlign = 61, +Packing = 62, +Requantize = 63, +Cast = 64, +HardSigmoid = 65, +SELU = 66, +HardSwish = 67, +Noop = 68, +PixelShuffle = 69, +DeepCopy = 70, +Mish = 71, +StatisticsPooling = 72, +Swish = 73, +Gemm = 74, +GroupNorm = 75, +LayerNorm = 76, +Softplus = 77, +GRU = 78, +MultiHeadAttention = 79, +GELU = 80, +Convolution1D = 81, +Pooling1D = 82, +ConvolutionDepthWise1D = 83, +Convolution3D = 84, +ConvolutionDepthWise3D = 85, +Pooling3D = 86, +MatMul = 87, +Deconvolution1D = 88, +DeconvolutionDepthWise1D = 89, +Deconvolution3D = 90, +DeconvolutionDepthWise3D = 91, +Einsum = 92, +DeformableConv2D = 93, +GLU = 94, +Fold = 95, +Unfold = 96, +GridSample = 97, +CumulativeSum = 98, +CopyTo = 99, +Erf = 100, +Diag = 101, +CELU = 102, +Shrink = 103, +RMSNorm = 104, +Spectrogram = 105, +InverseSpectrogram = 106, +Flip = 107, +SDPA = 108, +RotaryEmbed = 109, + diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/mat.h b/app/libs/ncnn/arm64-v8a/include/ncnn/mat.h new file mode 100644 index 0000000..9e353aa --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/mat.h @@ -0,0 +1,1868 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_MAT_H +#define NCNN_MAT_H + +#include +#include +#if __ARM_NEON +#include +#endif +#if __SSE2__ +#include +#if __AVX__ +#include +#endif +#endif +#if __mips_msa +#include +#endif +#if __loongarch_sx +#include +#endif +#if __riscv_vector +#include +#include "cpu.h" // cpu_riscv_vlenb() +#endif + +#include "allocator.h" +#include "option.h" +#include "platform.h" + +#if NCNN_PIXEL +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 +#include +#include +#endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API +#endif // NCNN_PIXEL + +namespace ncnn { + +#if NCNN_VULKAN +class VkMat; +class VkImageMat; +#endif // NCNN_VULKAN + +// the three dimension matrix +class NCNN_EXPORT Mat +{ +public: + // empty + Mat(); + // vec + Mat(int w, size_t elemsize = 4u, Allocator* allocator = 0); + // image + Mat(int w, int h, size_t elemsize = 4u, Allocator* allocator = 0); + // dim + Mat(int w, int h, int c, size_t elemsize = 4u, Allocator* allocator = 0); + // cube + Mat(int w, int h, int d, int c, size_t elemsize = 4u, Allocator* allocator = 0); + // packed vec + Mat(int w, size_t elemsize, int elempack, Allocator* allocator = 0); + // packed image + Mat(int w, int h, size_t elemsize, int elempack, Allocator* allocator = 0); + // packed dim + Mat(int w, int h, int c, size_t elemsize, int elempack, Allocator* allocator = 0); + // packed cube + Mat(int w, int h, int d, int c, size_t elemsize, int elempack, Allocator* allocator = 0); + // copy + Mat(const Mat& m); + // external vec + Mat(int w, void* data, size_t elemsize = 4u, Allocator* allocator = 0); + // external image + Mat(int w, int h, void* data, size_t elemsize = 4u, Allocator* allocator = 0); + // external dim + Mat(int w, int h, int c, void* data, size_t elemsize = 4u, Allocator* allocator = 0); + // external cube + Mat(int w, int h, int d, int c, void* data, size_t elemsize = 4u, Allocator* allocator = 0); + // external packed vec + Mat(int w, void* data, size_t elemsize, int elempack, Allocator* allocator = 0); + // external packed image + Mat(int w, int h, void* data, size_t elemsize, int elempack, Allocator* allocator = 0); + // external packed dim + Mat(int w, int h, int c, void* data, size_t elemsize, int elempack, Allocator* allocator = 0); + // external packed cube + Mat(int w, int h, int d, int c, void* data, size_t elemsize, int elempack, Allocator* allocator = 0); + // release + ~Mat(); + // assign + Mat& operator=(const Mat& m); + // set all + void fill(float v); + void fill(int v); +#if __ARM_NEON + void fill(float32x4_t _v); + void fill(uint16x4_t _v); +#if !defined(_MSC_VER) + void fill(int32x4_t _v); +#endif + void fill(int32x4_t _v0, int32x4_t _v1); +#if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if !defined(_MSC_VER) + void fill(float16x4_t _v); + void fill(float16x8_t _v); +#endif +#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#endif // __ARM_NEON +#if __SSE2__ +#if __AVX__ +#if __AVX512F__ + void fill(const __m512& _v); +#endif // __AVX512F__ + void fill(const __m256& _v, int i = 0); +#endif // __AVX__ + void fill(const __m128& _v); + void fill(const __m128i& _v); +#endif // __SSE2__ +#if __mips_msa + void fill(v4f32 _v); +#endif // __mips_msa +#if __loongarch_sx + void fill(__m128 _v); +#endif //__loongarch_sx +#if __riscv_vector + void fill(vfloat32m1_t _v); + void fill(vuint16m1_t _v); + void fill(vint8m1_t _v); +#if __riscv_zvfh + void fill(vfloat16m1_t _v); +#endif // __riscv_zvfh +#endif // __riscv_vector + template + void fill(T v); + // deep copy + Mat clone(Allocator* allocator = 0) const; + // deep copy from other mat, inplace + void clone_from(const ncnn::Mat& mat, Allocator* allocator = 0); + // reshape vec + Mat reshape(int w, Allocator* allocator = 0) const; + // reshape image + Mat reshape(int w, int h, Allocator* allocator = 0) const; + // reshape dim + Mat reshape(int w, int h, int c, Allocator* allocator = 0) const; + // reshape cube + Mat reshape(int w, int h, int d, int c, Allocator* allocator = 0) const; + // allocate vec + void create(int w, size_t elemsize = 4u, Allocator* allocator = 0); + // allocate image + void create(int w, int h, size_t elemsize = 4u, Allocator* allocator = 0); + // allocate dim + void create(int w, int h, int c, size_t elemsize = 4u, Allocator* allocator = 0); + // allocate cube + void create(int w, int h, int d, int c, size_t elemsize = 4u, Allocator* allocator = 0); + // allocate packed vec + void create(int w, size_t elemsize, int elempack, Allocator* allocator = 0); + // allocate packed image + void create(int w, int h, size_t elemsize, int elempack, Allocator* allocator = 0); + // allocate packed dim + void create(int w, int h, int c, size_t elemsize, int elempack, Allocator* allocator = 0); + // allocate packed cube + void create(int w, int h, int d, int c, size_t elemsize, int elempack, Allocator* allocator = 0); + // allocate like + void create_like(const Mat& m, Allocator* allocator = 0); +#if NCNN_VULKAN + // allocate like + void create_like(const VkMat& m, Allocator* allocator = 0); + // allocate like + void create_like(const VkImageMat& im, Allocator* allocator = 0); +#endif // NCNN_VULKAN + // refcount++ + void addref(); + // refcount-- + void release(); + + bool empty() const; + size_t total() const; + + // bits per element + int elembits() const; + + // shape only + Mat shape() const; + + // data reference + Mat channel(int c); + const Mat channel(int c) const; + Mat depth(int z); + const Mat depth(int z) const; + float* row(int y); + const float* row(int y) const; + template + T* row(int y); + template + const T* row(int y) const; + + // range reference + Mat channel_range(int c, int channels); + const Mat channel_range(int c, int channels) const; + Mat depth_range(int z, int depths); + const Mat depth_range(int z, int depths) const; + Mat row_range(int y, int rows); + const Mat row_range(int y, int rows) const; + Mat range(int x, int n); + const Mat range(int x, int n) const; + + // access raw data + template + operator T*(); + template + operator const T*() const; + + // convenient access float vec element + float& operator[](size_t i); + const float& operator[](size_t i) const; + +#if NCNN_PIXEL + enum PixelType + { + PIXEL_CONVERT_SHIFT = 16, + PIXEL_FORMAT_MASK = 0x0000ffff, + PIXEL_CONVERT_MASK = 0xffff0000, + + PIXEL_RGB = 1, + PIXEL_BGR = 2, + PIXEL_GRAY = 3, + PIXEL_RGBA = 4, + PIXEL_BGRA = 5, + + PIXEL_RGB2BGR = PIXEL_RGB | (PIXEL_BGR << PIXEL_CONVERT_SHIFT), + PIXEL_RGB2GRAY = PIXEL_RGB | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT), + PIXEL_RGB2RGBA = PIXEL_RGB | (PIXEL_RGBA << PIXEL_CONVERT_SHIFT), + PIXEL_RGB2BGRA = PIXEL_RGB | (PIXEL_BGRA << PIXEL_CONVERT_SHIFT), + + PIXEL_BGR2RGB = PIXEL_BGR | (PIXEL_RGB << PIXEL_CONVERT_SHIFT), + PIXEL_BGR2GRAY = PIXEL_BGR | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT), + PIXEL_BGR2RGBA = PIXEL_BGR | (PIXEL_RGBA << PIXEL_CONVERT_SHIFT), + PIXEL_BGR2BGRA = PIXEL_BGR | (PIXEL_BGRA << PIXEL_CONVERT_SHIFT), + + PIXEL_GRAY2RGB = PIXEL_GRAY | (PIXEL_RGB << PIXEL_CONVERT_SHIFT), + PIXEL_GRAY2BGR = PIXEL_GRAY | (PIXEL_BGR << PIXEL_CONVERT_SHIFT), + PIXEL_GRAY2RGBA = PIXEL_GRAY | (PIXEL_RGBA << PIXEL_CONVERT_SHIFT), + PIXEL_GRAY2BGRA = PIXEL_GRAY | (PIXEL_BGRA << PIXEL_CONVERT_SHIFT), + + PIXEL_RGBA2RGB = PIXEL_RGBA | (PIXEL_RGB << PIXEL_CONVERT_SHIFT), + PIXEL_RGBA2BGR = PIXEL_RGBA | (PIXEL_BGR << PIXEL_CONVERT_SHIFT), + PIXEL_RGBA2GRAY = PIXEL_RGBA | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT), + PIXEL_RGBA2BGRA = PIXEL_RGBA | (PIXEL_BGRA << PIXEL_CONVERT_SHIFT), + + PIXEL_BGRA2RGB = PIXEL_BGRA | (PIXEL_RGB << PIXEL_CONVERT_SHIFT), + PIXEL_BGRA2BGR = PIXEL_BGRA | (PIXEL_BGR << PIXEL_CONVERT_SHIFT), + PIXEL_BGRA2GRAY = PIXEL_BGRA | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT), + PIXEL_BGRA2RGBA = PIXEL_BGRA | (PIXEL_RGBA << PIXEL_CONVERT_SHIFT), + }; + // convenient construct from pixel data + static Mat from_pixels(const unsigned char* pixels, int type, int w, int h, Allocator* allocator = 0); + // convenient construct from pixel data with stride(bytes-per-row) parameter + static Mat from_pixels(const unsigned char* pixels, int type, int w, int h, int stride, Allocator* allocator = 0); + // convenient construct from pixel data and resize to specific size + static Mat from_pixels_resize(const unsigned char* pixels, int type, int w, int h, int target_width, int target_height, Allocator* allocator = 0); + // convenient construct from pixel data and resize to specific size with stride(bytes-per-row) parameter + static Mat from_pixels_resize(const unsigned char* pixels, int type, int w, int h, int stride, int target_width, int target_height, Allocator* allocator = 0); + // convenient construct from pixel data roi + static Mat from_pixels_roi(const unsigned char* pixels, int type, int w, int h, int roix, int roiy, int roiw, int roih, Allocator* allocator = 0); + // convenient construct from pixel data roi with stride(bytes-per-row) parameter + static Mat from_pixels_roi(const unsigned char* pixels, int type, int w, int h, int stride, int roix, int roiy, int roiw, int roih, Allocator* allocator = 0); + // convenient construct from pixel data roi and resize to specific size + static Mat from_pixels_roi_resize(const unsigned char* pixels, int type, int w, int h, int roix, int roiy, int roiw, int roih, int target_width, int target_height, Allocator* allocator = 0); + // convenient construct from pixel data roi and resize to specific size with stride(bytes-per-row) parameter + static Mat from_pixels_roi_resize(const unsigned char* pixels, int type, int w, int h, int stride, int roix, int roiy, int roiw, int roih, int target_width, int target_height, Allocator* allocator = 0); + + // convenient export to pixel data + void to_pixels(unsigned char* pixels, int type) const; + // convenient export to pixel data with stride(bytes-per-row) parameter + void to_pixels(unsigned char* pixels, int type, int stride) const; + // convenient export to pixel data and resize to specific size + void to_pixels_resize(unsigned char* pixels, int type, int target_width, int target_height) const; + // convenient export to pixel data and resize to specific size with stride(bytes-per-row) parameter + void to_pixels_resize(unsigned char* pixels, int type, int target_width, int target_height, int target_stride) const; + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 + // convenient construct from android Bitmap + static Mat from_android_bitmap(JNIEnv* env, jobject bitmap, int type_to, Allocator* allocator = 0); + // convenient construct from android Bitmap and resize to specific size + static Mat from_android_bitmap_resize(JNIEnv* env, jobject bitmap, int type_to, int target_width, int target_height, Allocator* allocator = 0); + // convenient construct from android Bitmap roi + static Mat from_android_bitmap_roi(JNIEnv* env, jobject bitmap, int type_to, int roix, int roiy, int roiw, int roih, Allocator* allocator = 0); + // convenient construct from android Bitmap roi and resize to specific size + static Mat from_android_bitmap_roi_resize(JNIEnv* env, jobject bitmap, int type_to, int roix, int roiy, int roiw, int roih, int target_width, int target_height, Allocator* allocator = 0); + // convenient export to android Bitmap and resize to the android Bitmap size + void to_android_bitmap(JNIEnv* env, jobject bitmap, int type_from) const; +#endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API +#endif // NCNN_PIXEL + + // substract channel-wise mean values, then multiply by normalize values, pass 0 to skip + void substract_mean_normalize(const float* mean_vals, const float* norm_vals); + + // convenient construct from half precision floating point data + static Mat from_float16(const unsigned short* data, int size); + + // pointer to the data + void* data; + + // pointer to the reference counter + // when points to user-allocated data, the pointer is NULL + int* refcount; + + // element size in bytes + // 4 = float32/int32 + // 2 = float16 + // 1 = int8/uint8 + // 0 = empty + size_t elemsize; + + // packed count inside element + // c/1-d-h-w-1 c/1-h-w-1 h/1-w-1 w/1-1 scalar + // c/4-d-h-w-4 c/4-h-w-4 h/4-w-4 w/4-4 sse/neon + // c/8-d-h-w-8 c/8-h-w-8 h/8-w-8 w/8-8 avx/fp16 + int elempack; + + // the allocator + Allocator* allocator; + + // the dimension rank + int dims; + + int w; + int h; + int d; + int c; + + size_t cstep; +}; + +#if NCNN_VULKAN + +// the three dimension matrix, vulkan version +class NCNN_EXPORT VkMat +{ +public: + // empty + VkMat(); + // vec + VkMat(int w, size_t elemsize, VkAllocator* allocator); + // image + VkMat(int w, int h, size_t elemsize, VkAllocator* allocator); + // dim + VkMat(int w, int h, int c, size_t elemsize, VkAllocator* allocator); + // cube + VkMat(int w, int h, int d, int c, size_t elemsize, VkAllocator* allocator); + // packed vec + VkMat(int w, size_t elemsize, int elempack, VkAllocator* allocator); + // packed image + VkMat(int w, int h, size_t elemsize, int elempack, VkAllocator* allocator); + // packed dim + VkMat(int w, int h, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // packed cube + VkMat(int w, int h, int d, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // copy + VkMat(const VkMat& m); + // external vec + VkMat(int w, VkBufferMemory* data, size_t elemsize, VkAllocator* allocator); + // external image + VkMat(int w, int h, VkBufferMemory* data, size_t elemsize, VkAllocator* allocator); + // external dim + VkMat(int w, int h, int c, VkBufferMemory* data, size_t elemsize, VkAllocator* allocator); + // external cube + VkMat(int w, int h, int d, int c, VkBufferMemory* data, size_t elemsize, VkAllocator* allocator); + // external packed vec + VkMat(int w, VkBufferMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed image + VkMat(int w, int h, VkBufferMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed dim + VkMat(int w, int h, int c, VkBufferMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed cube + VkMat(int w, int h, int d, int c, VkBufferMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // release + ~VkMat(); + // assign + VkMat& operator=(const VkMat& m); + // allocate vec + void create(int w, size_t elemsize, VkAllocator* allocator); + // allocate image + void create(int w, int h, size_t elemsize, VkAllocator* allocator); + // allocate dim + void create(int w, int h, int c, size_t elemsize, VkAllocator* allocator); + // allocate cube + void create(int w, int h, int d, int c, size_t elemsize, VkAllocator* allocator); + // allocate packed vec + void create(int w, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed image + void create(int w, int h, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed dim + void create(int w, int h, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed cube + void create(int w, int h, int d, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate like + void create_like(const Mat& m, VkAllocator* allocator); + // allocate like + void create_like(const VkMat& m, VkAllocator* allocator); + // allocate like + void create_like(const VkImageMat& im, VkAllocator* allocator); + + // mapped + Mat mapped() const; + void* mapped_ptr() const; + + // refcount++ + void addref(); + // refcount-- + void release(); + + bool empty() const; + size_t total() const; + + // bits per element + int elembits() const; + + // shape only + Mat shape() const; + + // low-level reference + VkBuffer buffer() const; + size_t buffer_offset() const; + size_t buffer_capacity() const; + + // device buffer + VkBufferMemory* data; + + // pointer to the reference counter + // when points to user-allocated data, the pointer is NULL + int* refcount; + + // element size in bytes + // 4 = float32/int32 + // 2 = float16 + // 1 = int8/uint8 + // 0 = empty + size_t elemsize; + + // packed count inside element + // c/1-d-h-w-1 c/1-h-w-1 h/1-w-1 w/1-1 scalar + // c/4-d-h-w-4 c/4-h-w-4 h/4-w-4 w/4-4 sse/neon + // c/8-d-h-w-8 c/8-h-w-8 h/8-w-8 w/8-8 avx/fp16 + int elempack; + + // the allocator + VkAllocator* allocator; + + // the dimension rank + int dims; + + int w; + int h; + int d; + int c; + + size_t cstep; +}; + +class NCNN_EXPORT VkImageMat +{ +public: + // empty + VkImageMat(); + // vec + VkImageMat(int w, size_t elemsize, VkAllocator* allocator); + // image + VkImageMat(int w, int h, size_t elemsize, VkAllocator* allocator); + // dim + VkImageMat(int w, int h, int c, size_t elemsize, VkAllocator* allocator); + // cube + VkImageMat(int w, int h, int d, int c, size_t elemsize, VkAllocator* allocator); + // packed vec + VkImageMat(int w, size_t elemsize, int elempack, VkAllocator* allocator); + // packed image + VkImageMat(int w, int h, size_t elemsize, int elempack, VkAllocator* allocator); + // packed dim + VkImageMat(int w, int h, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // packed cube + VkImageMat(int w, int h, int d, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // copy + VkImageMat(const VkImageMat& m); + // external vec + VkImageMat(int w, VkImageMemory* data, size_t elemsize, VkAllocator* allocator); + // external image + VkImageMat(int w, int h, VkImageMemory* data, size_t elemsize, VkAllocator* allocator); + // external dim + VkImageMat(int w, int h, int c, VkImageMemory* data, size_t elemsize, VkAllocator* allocator); + // external cube + VkImageMat(int w, int h, int d, int c, VkImageMemory* data, size_t elemsize, VkAllocator* allocator); + // external packed vec + VkImageMat(int w, VkImageMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed image + VkImageMat(int w, int h, VkImageMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed dim + VkImageMat(int w, int h, int c, VkImageMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed cube + VkImageMat(int w, int h, int d, int c, VkImageMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // release + ~VkImageMat(); + // assign + VkImageMat& operator=(const VkImageMat& m); + // allocate vec + void create(int w, size_t elemsize, VkAllocator* allocator); + // allocate image + void create(int w, int h, size_t elemsize, VkAllocator* allocator); + // allocate dim + void create(int w, int h, int c, size_t elemsize, VkAllocator* allocator); + // allocate cube + void create(int w, int h, int d, int c, size_t elemsize, VkAllocator* allocator); + // allocate packed vec + void create(int w, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed image + void create(int w, int h, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed dim + void create(int w, int h, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed cube + void create(int w, int h, int d, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate like + void create_like(const Mat& m, VkAllocator* allocator); + // allocate like + void create_like(const VkMat& m, VkAllocator* allocator); + // allocate like + void create_like(const VkImageMat& im, VkAllocator* allocator); + + // mapped + Mat mapped() const; + void* mapped_ptr() const; + + // refcount++ + void addref(); + // refcount-- + void release(); + + bool empty() const; + size_t total() const; + + // bits per element + int elembits() const; + + // shape only + Mat shape() const; + + // low-level reference + VkImage image() const; + VkImageView imageview() const; + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 + // convenient construct from android hardware buffer + static VkImageMat from_android_hardware_buffer(VkAndroidHardwareBufferImageAllocator* allocator); +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + + // device image + VkImageMemory* data; + + // pointer to the reference counter + // when points to user-allocated data, the pointer is NULL + int* refcount; + + // element size in bytes + // 4 = float32/int32 + // 2 = float16 + // 1 = int8/uint8 + // 0 = empty + size_t elemsize; + + // packed count inside element + // c/1-d-h-w-1 c/1-h-w-1 h/1-w-1 w/1-1 scalar + // c/4-d-h-w-4 c/4-h-w-4 h/4-w-4 w/4-4 sse/neon + // c/8-d-h-w-8 c/8-h-w-8 h/8-w-8 w/8-8 avx/fp16 + int elempack; + + // the allocator + VkAllocator* allocator; + + // the dimension rank + int dims; + + int w; + int h; + int d; + int c; +}; + +// type for vulkan specialization constant and push constant +union vk_specialization_type +{ + int i; + float f; + uint32_t u32; +}; +union vk_constant_type +{ + int i; + float f; + uint32_t u32; +}; +#endif // NCNN_VULKAN + +// misc function +#if NCNN_PIXEL +// convert yuv420sp(nv21) to rgb, the fast approximate version +NCNN_EXPORT void yuv420sp2rgb(const unsigned char* yuv420sp, int w, int h, unsigned char* rgb); +// convert yuv420sp(nv12) to rgb, the fast approximate version +NCNN_EXPORT void yuv420sp2rgb_nv12(const unsigned char* yuv420sp, int w, int h, unsigned char* rgb); +// convert yuv420sp(nv21) to rgb with half resize, the faster approximate version +NCNN_EXPORT void yuv420sp2rgb_half(const unsigned char* yuv420sp, int w, int h, unsigned char* rgb); +// image pixel bilinear resize +NCNN_EXPORT void resize_bilinear_c1(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h); +NCNN_EXPORT void resize_bilinear_c2(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h); +NCNN_EXPORT void resize_bilinear_c3(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h); +NCNN_EXPORT void resize_bilinear_c4(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h); +// image pixel bilinear resize with stride(bytes-per-row) parameter +NCNN_EXPORT void resize_bilinear_c1(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride); +NCNN_EXPORT void resize_bilinear_c2(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride); +NCNN_EXPORT void resize_bilinear_c3(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride); +NCNN_EXPORT void resize_bilinear_c4(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride); +// image pixel bilinear resize, convenient wrapper for yuv420sp(nv21/nv12) +NCNN_EXPORT void resize_bilinear_yuv420sp(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h); +#endif // NCNN_PIXEL +#if NCNN_PIXEL_ROTATE +// type is the from type, 6 means rotating from 6 to 1 +// +// 1 2 3 4 5 6 7 8 +// +// 888888 888888 88 88 8888888888 88 88 8888888888 +// 88 88 88 88 88 88 88 88 88 88 88 88 +// 8888 8888 8888 8888 88 8888888888 8888888888 88 +// 88 88 88 88 +// 88 88 888888 888888 +// +// ref http://sylvana.net/jpegcrop/exif_orientation.html +// image pixel kanna rotate +NCNN_EXPORT void kanna_rotate_c1(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, int type); +NCNN_EXPORT void kanna_rotate_c2(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, int type); +NCNN_EXPORT void kanna_rotate_c3(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, int type); +NCNN_EXPORT void kanna_rotate_c4(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, int type); +// image pixel kanna rotate with stride(bytes-per-row) parameter +NCNN_EXPORT void kanna_rotate_c1(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, int type); +NCNN_EXPORT void kanna_rotate_c2(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, int type); +NCNN_EXPORT void kanna_rotate_c3(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, int type); +NCNN_EXPORT void kanna_rotate_c4(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, int type); +// image pixel kanna rotate, convenient wrapper for yuv420sp(nv21/nv12) +NCNN_EXPORT void kanna_rotate_yuv420sp(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, int type); +#endif // NCNN_PIXEL_ROTATE +#if NCNN_PIXEL_AFFINE +// resolve affine transform matrix from rotation angle, scale factor and x y offset +NCNN_EXPORT void get_rotation_matrix(float angle, float scale, float dx, float dy, float* tm); +// resolve affine transform matrix from two set of points, num_point must be >= 2 +NCNN_EXPORT void get_affine_transform(const float* points_from, const float* points_to, int num_point, float* tm); +// resolve the inversion affine transform matrix +NCNN_EXPORT void invert_affine_transform(const float* tm, float* tm_inv); +// image pixel bilinear warpaffine inverse transform, set -233 for transparent border color, the color RGBA is little-endian encoded +NCNN_EXPORT void warpaffine_bilinear_c1(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c2(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c3(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c4(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, const float* tm, int type = 0, unsigned int v = 0); +// image pixel bilinear warpaffine inverse transform with stride(bytes-per-row) parameter, set -233 for transparent border color, the color RGBA is little-endian encoded +NCNN_EXPORT void warpaffine_bilinear_c1(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c2(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c3(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c4(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, const float* tm, int type = 0, unsigned int v = 0); +// image pixel bilinear warpaffine, convenient wrapper for yuv420sp(nv21/nv12), set -233 for transparent border color, the color YUV_ is little-endian encoded +NCNN_EXPORT void warpaffine_bilinear_yuv420sp(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, const float* tm, int type = 0, unsigned int v = 0); +#endif // NCNN_PIXEL_AFFINE +#if NCNN_PIXEL_DRAWING +// draw rectangle, set thickness -1 for filled rectangle, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_rectangle_c1(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c2(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c3(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c4(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +// draw rectangle with stride(bytes-per-row) parameter, set thickness -1 for filled rectangle, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_rectangle_c1(unsigned char* pixels, int w, int h, int stride, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c2(unsigned char* pixels, int w, int h, int stride, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c3(unsigned char* pixels, int w, int h, int stride, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c4(unsigned char* pixels, int w, int h, int stride, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +// draw rectangle, convenient wrapper for yuv420sp(nv21/nv12), set thickness -1 for filled rectangle, the color YUV_ is little-endian encoded +NCNN_EXPORT void draw_rectangle_yuv420sp(unsigned char* yuv420sp, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +// draw circle, set thickness -1 for filled circle, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_circle_c1(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c2(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c3(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c4(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +// draw circle with stride(bytes-per-row) parameter, set thickness -1 for filled circle, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_circle_c1(unsigned char* pixels, int w, int h, int stride, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c2(unsigned char* pixels, int w, int h, int stride, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c3(unsigned char* pixels, int w, int h, int stride, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c4(unsigned char* pixels, int w, int h, int stride, int cx, int cy, int radius, unsigned int color, int thickness); +// draw circle, convenient wrapper for yuv420sp(nv21/nv12), set thickness -1 for filled circle, the color YUV_ is little-endian encoded +NCNN_EXPORT void draw_circle_yuv420sp(unsigned char* yuv420sp, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +// draw line, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_line_c1(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c2(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c3(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c4(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +// draw line with stride(bytes-per-row) parameter, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_line_c1(unsigned char* pixels, int w, int h, int stride, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c2(unsigned char* pixels, int w, int h, int stride, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c3(unsigned char* pixels, int w, int h, int stride, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c4(unsigned char* pixels, int w, int h, int stride, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +// draw line, convenient wrapper for yuv420sp(nv21/nv12), the color YUV_ is little-endian encoded +NCNN_EXPORT void draw_line_yuv420sp(unsigned char* yuv420sp, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +// resolve text bounding box size +NCNN_EXPORT void get_text_drawing_size(const char* text, int fontpixelsize, int* w, int* h); +// draw ascii printables and newline, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_text_c1(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c2(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c3(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c4(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +// draw ascii printables and newline with stride(bytes-per-row) parameter, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_text_c1(unsigned char* pixels, int w, int h, int stride, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c2(unsigned char* pixels, int w, int h, int stride, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c3(unsigned char* pixels, int w, int h, int stride, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c4(unsigned char* pixels, int w, int h, int stride, const char* text, int x, int y, int fontpixelsize, unsigned int color); +// draw ascii printables and newline, convenient wrapper for yuv420sp(nv21/nv12), the color YUV_ is little-endian encoded +NCNN_EXPORT void draw_text_yuv420sp(unsigned char* yuv420sp, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +#endif // NCNN_PIXEL_DRAWING + +// type conversion +// convert float to half precision floating point +NCNN_EXPORT unsigned short float32_to_float16(float value); +// convert half precision floating point to float +NCNN_EXPORT float float16_to_float32(unsigned short value); +// convert float to brain half +NCNN_EXPORT NCNN_FORCEINLINE unsigned short float32_to_bfloat16(float value) +{ + // 16 : 16 + union + { + unsigned int u; + float f; + } tmp; + tmp.f = value; + return tmp.u >> 16; +} +// convert brain half to float +NCNN_EXPORT NCNN_FORCEINLINE float bfloat16_to_float32(unsigned short value) +{ + // 16 : 16 + union + { + unsigned int u; + float f; + } tmp; + tmp.u = value << 16; + return tmp.f; +} +// convert float16 to float8 e4m3 +NCNN_EXPORT unsigned char float16_to_float8(unsigned short value); +// convert float8 e4m3 to float16 +NCNN_EXPORT unsigned short float8_to_float16(unsigned char value); +// convert float16 to bfloat8 e5m2 +NCNN_EXPORT NCNN_FORCEINLINE unsigned char float16_to_bfloat8(unsigned short value) +{ + // 1 : 5 : 10 -> 1 : 5 : 2 + // direct truncation for bfloat8 e5m2, similar to bfloat16 + return value >> 8; +} +// convert bfloat8 e5m2 to float16 +NCNN_EXPORT NCNN_FORCEINLINE unsigned short bfloat8_to_float16(unsigned char value) +{ + // 1 : 5 : 2 -> 1 : 5 : 10 + // direct extension for bfloat8 e5m2, similar to bfloat16 + return value << 8; +} + +// mat process +enum BorderType +{ + BORDER_CONSTANT = 0, + BORDER_REPLICATE = 1, + BORDER_REFLECT = 2, + BORDER_TRANSPARENT = -233, +}; +NCNN_EXPORT void copy_make_border(const Mat& src, Mat& dst, int top, int bottom, int left, int right, int type, float v, const Option& opt = Option()); +NCNN_EXPORT void copy_make_border_3d(const Mat& src, Mat& dst, int top, int bottom, int left, int right, int front, int behind, int type, float v, const Option& opt = Option()); +NCNN_EXPORT void copy_cut_border(const Mat& src, Mat& dst, int top, int bottom, int left, int right, const Option& opt = Option()); +NCNN_EXPORT void copy_cut_border_3d(const Mat& src, Mat& dst, int top, int bottom, int left, int right, int front, int behind, const Option& opt = Option()); +NCNN_EXPORT void resize_nearest(const Mat& src, Mat& dst, int w, int h, const Option& opt = Option()); +NCNN_EXPORT void resize_bilinear(const Mat& src, Mat& dst, int w, int h, const Option& opt = Option()); +NCNN_EXPORT void resize_bicubic(const Mat& src, Mat& dst, int w, int h, const Option& opt = Option()); +NCNN_EXPORT void convert_packing(const Mat& src, Mat& dst, int elempack, const Option& opt = Option()); +NCNN_EXPORT void flatten(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void cast_float32_to_float16(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void cast_float16_to_float32(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void cast_int8_to_float32(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void cast_float32_to_bfloat16(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void cast_bfloat16_to_float32(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void quantize_to_int8(const Mat& src, Mat& dst, const Mat& scale_data, const Option& opt = Option()); +NCNN_EXPORT void dequantize_from_int32(const Mat& src, Mat& dst, const Mat& scale_data, const Mat& bias_data, const Option& opt = Option()); +NCNN_EXPORT void requantize_from_int32_to_int8(const Mat& src, Mat& dst, const Mat& scale_in_data, const Mat& scale_out_data, const Mat& bias_data, int activation_type, const Mat& activation_params, const Option& opt = Option()); + +NCNN_FORCEINLINE Mat::Mat() + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ +} + +NCNN_FORCEINLINE Mat::Mat(int _w, size_t _elemsize, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _elemsize, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, size_t _elemsize, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _elemsize, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _c, size_t _elemsize, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _d, int _c, size_t _elemsize, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _d, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _c, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _d, int _c, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _d, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(const Mat& m) + : data(m.data), refcount(m.refcount), elemsize(m.elemsize), elempack(m.elempack), allocator(m.allocator), dims(m.dims), w(m.w), h(m.h), d(m.d), c(m.c), cstep(m.cstep) +{ + addref(); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, void* _data, size_t _elemsize, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ + cstep = alignSize(w * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, void* _data, size_t _elemsize, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _c, void* _data, size_t _elemsize, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _d, int _c, void* _data, size_t _elemsize, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ + cstep = alignSize((size_t)w * h * d * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, void* _data, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ + cstep = alignSize(w * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, void* _data, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _c, void* _data, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _d, int _c, void* _data, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ + cstep = alignSize((size_t)w * h * d * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::~Mat() +{ + release(); +} + +NCNN_FORCEINLINE void Mat::fill(float _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + + int i = 0; +#if __ARM_NEON + float32x4_t _c = vdupq_n_f32(_v); + for (; i + 3 < size; i += 4) + { + vst1q_f32(ptr, _c); + ptr += 4; + } +#endif // __ARM_NEON + for (; i < size; i++) + { + *ptr++ = _v; + } +} + +NCNN_FORCEINLINE void Mat::fill(int _v) +{ + int size = (int)total(); + int* ptr = (int*)data; + + int i = 0; +#if __ARM_NEON + int32x4_t _c = vdupq_n_s32(_v); + for (; i + 3 < size; i += 4) + { + vst1q_s32(ptr, _c); + ptr += 4; + } +#endif // __ARM_NEON + for (; i < size; i++) + { + *ptr++ = _v; + } +} + +#if __ARM_NEON +NCNN_FORCEINLINE void Mat::fill(float32x4_t _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + vst1q_f32(ptr, _v); + ptr += 4; + } +} + +NCNN_FORCEINLINE void Mat::fill(uint16x4_t _v) +{ + int size = (int)total(); + unsigned short* ptr = (unsigned short*)data; + for (int i = 0; i < size; i++) + { + vst1_u16(ptr, _v); + ptr += 4; + } +} + +#if !defined(_MSC_VER) +NCNN_FORCEINLINE void Mat::fill(int32x4_t _v) +{ + int size = (int)total(); + int* ptr = (int*)data; + for (int i = 0; i < size; i++) + { + vst1q_s32(ptr, _v); + ptr += 4; + } +} +#endif + +NCNN_FORCEINLINE void Mat::fill(int32x4_t _v0, int32x4_t _v1) +{ + int size = (int)total(); + int* ptr = (int*)data; + for (int i = 0; i < size; i++) + { + vst1q_s32(ptr, _v0); + vst1q_s32(ptr + 4, _v1); + ptr += 8; + } +} +#if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if !defined(_MSC_VER) +NCNN_FORCEINLINE void Mat::fill(float16x4_t _v) +{ + int size = (int)total(); + __fp16* ptr = (__fp16*)data; + for (int i = 0; i < size; i++) + { + vst1_f16(ptr, _v); + ptr += 4; + } +} + +NCNN_FORCEINLINE void Mat::fill(float16x8_t _v) +{ + int size = (int)total(); + __fp16* ptr = (__fp16*)data; + for (int i = 0; i < size; i++) + { + vst1q_f16(ptr, _v); + ptr += 8; + } +} +#endif +#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#endif // __ARM_NEON + +#if __SSE2__ +#if __AVX__ +#if __AVX512F__ +NCNN_FORCEINLINE void Mat::fill(const __m512& _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + _mm512_storeu_ps(ptr, _v); + ptr += 16; + } +} +#endif // __AVX512F__ +NCNN_FORCEINLINE void Mat::fill(const __m256& _v, int _i) +{ + // old gcc cannot overload __m128 and __m256 type + // add a dummy int parameter for different mangled function symbol + (void)_i; + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + _mm256_storeu_ps(ptr, _v); + ptr += 8; + } +} +#endif // __AVX__ +NCNN_FORCEINLINE void Mat::fill(const __m128& _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + _mm_storeu_ps(ptr, _v); + ptr += 4; + } +} +NCNN_FORCEINLINE void Mat::fill(const __m128i& _v) +{ + int size = (int)total(); + unsigned short* ptr = (unsigned short*)data; + for (int i = 0; i < size; i++) + { + _mm_store_si128((__m128i*)ptr, _v); + ptr += 8; + } +} +#endif // __SSE2__ + +#if __mips_msa +NCNN_FORCEINLINE void Mat::fill(v4f32 _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + __msa_st_w((v4i32)_v, ptr, 0); + ptr += 4; + } +} +#endif // __mips_msa + +#if __loongarch_sx +NCNN_FORCEINLINE void Mat::fill(__m128 _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + __lsx_vst(_v, ptr, 0); + ptr += 4; + } +} +#endif // __loongarch_sx + +#if __riscv_vector +NCNN_FORCEINLINE void Mat::fill(vfloat32m1_t _v) +{ + const int packn = cpu_riscv_vlenb() / 4; + const size_t vl = __riscv_vsetvl_e32m1(packn); + + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + __riscv_vse32_v_f32m1(ptr, _v, vl); + ptr += packn; + } +} + +NCNN_FORCEINLINE void Mat::fill(vuint16m1_t _v) +{ + const int packn = cpu_riscv_vlenb() / 2; + const size_t vl = __riscv_vsetvl_e16m1(packn); + + int size = (int)total(); + unsigned short* ptr = (unsigned short*)data; + for (int i = 0; i < size; i++) + { + __riscv_vse16_v_u16m1(ptr, _v, vl); + ptr += packn; + } +} + +NCNN_FORCEINLINE void Mat::fill(vint8m1_t _v) +{ + const int packn = cpu_riscv_vlenb() / 1; + const size_t vl = __riscv_vsetvl_e8m1(packn); + + int size = (int)total(); + signed char* ptr = (signed char*)data; + for (int i = 0; i < size; i++) + { + __riscv_vse8_v_i8m1(ptr, _v, vl); + ptr += packn; + } +} +#if __riscv_zvfh +NCNN_FORCEINLINE void Mat::fill(vfloat16m1_t _v) +{ + const int packn = cpu_riscv_vlenb() / 2; + const size_t vl = __riscv_vsetvl_e16m1(packn); + + int size = (int)total(); + __fp16* ptr = (__fp16*)data; + for (int i = 0; i < size; i++) + { + __riscv_vse16_v_f16m1(ptr, _v, vl); + ptr += packn; + } +} +#endif // __riscv_zvfh +#endif // __riscv_vector + +template +NCNN_FORCEINLINE void Mat::fill(T _v) +{ + int size = (int)total(); + T* ptr = (T*)data; + for (int i = 0; i < size; i++) + { + ptr[i] = _v; + } +} + +NCNN_FORCEINLINE Mat& Mat::operator=(const Mat& m) +{ + if (this == &m) + return *this; + + if (m.refcount) + NCNN_XADD(m.refcount, 1); + + release(); + + data = m.data; + refcount = m.refcount; + elemsize = m.elemsize; + elempack = m.elempack; + allocator = m.allocator; + + dims = m.dims; + w = m.w; + h = m.h; + d = m.d; + c = m.c; + + cstep = m.cstep; + + return *this; +} + +NCNN_FORCEINLINE void Mat::addref() +{ + if (refcount) + NCNN_XADD(refcount, 1); +} + +NCNN_FORCEINLINE void Mat::release() +{ + if (refcount && NCNN_XADD(refcount, -1) == 1) + { + if (allocator) + allocator->fastFree(data); + else + fastFree(data); + } + + data = 0; + + elemsize = 0; + elempack = 0; + + dims = 0; + w = 0; + h = 0; + d = 0; + c = 0; + + cstep = 0; + + refcount = 0; +} + +NCNN_FORCEINLINE bool Mat::empty() const +{ + return data == 0 || total() == 0; +} + +NCNN_FORCEINLINE size_t Mat::total() const +{ + return cstep * c; +} + +NCNN_FORCEINLINE int Mat::elembits() const +{ + return elempack ? static_cast(elemsize * 8) / elempack : 0; +} + +NCNN_FORCEINLINE Mat Mat::shape() const +{ + if (dims == 1) + return Mat(w * elempack, (void*)0); + if (dims == 2) + return Mat(w, h * elempack, (void*)0); + if (dims == 3) + return Mat(w, h, c * elempack, (void*)0); + if (dims == 4) + return Mat(w, h, d, c * elempack, (void*)0); + + return Mat(); +} + +NCNN_FORCEINLINE Mat Mat::channel(int _c) +{ + Mat m(w, h, d, (unsigned char*)data + cstep * _c * elemsize, elemsize, elempack, allocator); + m.dims = dims - 1; + if (dims == 4) + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::channel(int _c) const +{ + Mat m(w, h, d, (unsigned char*)data + cstep * _c * elemsize, elemsize, elempack, allocator); + m.dims = dims - 1; + if (dims == 4) + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE Mat Mat::depth(int z) +{ + Mat m(w, h, (unsigned char*)data + (size_t)w * h * z * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::depth(int z) const +{ + Mat m(w, h, (unsigned char*)data + (size_t)w * h * z * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE float* Mat::row(int y) +{ + return (float*)((unsigned char*)data + (size_t)w * y * elemsize); +} + +NCNN_FORCEINLINE const float* Mat::row(int y) const +{ + return (const float*)((unsigned char*)data + (size_t)w * y * elemsize); +} + +template +NCNN_FORCEINLINE T* Mat::row(int y) +{ + return (T*)((unsigned char*)data + (size_t)w * y * elemsize); +} + +template +NCNN_FORCEINLINE const T* Mat::row(int y) const +{ + return (const T*)((unsigned char*)data + (size_t)w * y * elemsize); +} + +NCNN_FORCEINLINE Mat Mat::channel_range(int _c, int channels) +{ + Mat m(w, h, d, channels, (unsigned char*)data + cstep * _c * elemsize, elemsize, elempack, allocator); + m.dims = dims; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::channel_range(int _c, int channels) const +{ + Mat m(w, h, d, channels, (unsigned char*)data + cstep * _c * elemsize, elemsize, elempack, allocator); + m.dims = dims; + return m; +} + +NCNN_FORCEINLINE Mat Mat::depth_range(int z, int depths) +{ + Mat m(w, h, depths, (unsigned char*)data + (size_t)w * h * z * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::depth_range(int z, int depths) const +{ + Mat m(w, h, depths, (unsigned char*)data + (size_t)w * h * z * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE Mat Mat::row_range(int y, int rows) +{ + Mat m(w, rows, (unsigned char*)data + (size_t)w * y * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * rows; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::row_range(int y, int rows) const +{ + Mat m(w, rows, (unsigned char*)data + (size_t)w * y * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * rows; + return m; +} + +NCNN_FORCEINLINE Mat Mat::range(int x, int n) +{ + Mat m(n, (unsigned char*)data + x * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)n; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::range(int x, int n) const +{ + Mat m(n, (unsigned char*)data + x * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)n; + return m; +} + +template +NCNN_FORCEINLINE Mat::operator T*() +{ + return (T*)data; +} + +template +NCNN_FORCEINLINE Mat::operator const T*() const +{ + return (const T*)data; +} + +NCNN_FORCEINLINE float& Mat::operator[](size_t i) +{ + return ((float*)data)[i]; +} + +NCNN_FORCEINLINE const float& Mat::operator[](size_t i) const +{ + return ((const float*)data)[i]; +} + +#if NCNN_VULKAN + +NCNN_FORCEINLINE VkMat::VkMat() + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _c, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _d, int _c, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _d, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _c, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _d, int _c, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _d, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(const VkMat& m) + : data(m.data), refcount(m.refcount), elemsize(m.elemsize), elempack(m.elempack), allocator(m.allocator), dims(m.dims), w(m.w), h(m.h), d(m.d), c(m.c) +{ + addref(); + + cstep = m.cstep; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, VkBufferMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ + cstep = alignSize(w * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, VkBufferMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _c, VkBufferMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _d, int _c, VkBufferMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ + cstep = alignSize((size_t)w * h * d * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, VkBufferMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ + cstep = alignSize(w * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, VkBufferMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _c, VkBufferMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _d, int _c, VkBufferMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ + cstep = alignSize((size_t)w * h * d * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::~VkMat() +{ + release(); +} + +NCNN_FORCEINLINE VkMat& VkMat::operator=(const VkMat& m) +{ + if (this == &m) + return *this; + + if (m.refcount) + NCNN_XADD(m.refcount, 1); + + release(); + + data = m.data; + refcount = m.refcount; + elemsize = m.elemsize; + elempack = m.elempack; + allocator = m.allocator; + + dims = m.dims; + w = m.w; + h = m.h; + d = m.d; + c = m.c; + + cstep = m.cstep; + + return *this; +} + +NCNN_FORCEINLINE Mat VkMat::mapped() const +{ + if (!allocator->mappable) + return Mat(); + + if (dims == 1) + return Mat(w, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 2) + return Mat(w, h, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 3) + return Mat(w, h, c, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 4) + return Mat(w, h, d, c, mapped_ptr(), elemsize, elempack, 0); + + return Mat(); +} + +NCNN_FORCEINLINE void* VkMat::mapped_ptr() const +{ + if (!allocator->mappable) + return 0; + + return (unsigned char*)data->mapped_ptr + data->offset; +} + +NCNN_FORCEINLINE void VkMat::addref() +{ + if (refcount) + NCNN_XADD(refcount, 1); +} + +NCNN_FORCEINLINE void VkMat::release() +{ + if (refcount && NCNN_XADD(refcount, -1) == 1) + { + if (allocator && data) + { + allocator->fastFree(data); + } + } + + data = 0; + + elemsize = 0; + elempack = 0; + + dims = 0; + w = 0; + h = 0; + d = 0; + c = 0; + + cstep = 0; + + refcount = 0; +} + +NCNN_FORCEINLINE bool VkMat::empty() const +{ + return data == 0 || total() == 0; +} + +NCNN_FORCEINLINE size_t VkMat::total() const +{ + return cstep * c; +} + +NCNN_FORCEINLINE int VkMat::elembits() const +{ + return elempack ? static_cast(elemsize) * 8 / elempack : 0; +} + +NCNN_FORCEINLINE Mat VkMat::shape() const +{ + if (dims == 1) + return Mat(w * elempack, (void*)0); + if (dims == 2) + return Mat(w, h * elempack, (void*)0); + if (dims == 3) + return Mat(w, h, c * elempack, (void*)0); + if (dims == 4) + return Mat(w, h, d, c * elempack, (void*)0); + + return Mat(); +} + +NCNN_FORCEINLINE VkBuffer VkMat::buffer() const +{ + return data->buffer; +} + +NCNN_FORCEINLINE size_t VkMat::buffer_offset() const +{ + return data->offset; +} + +NCNN_FORCEINLINE size_t VkMat::buffer_capacity() const +{ + return data->capacity; +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat() + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _c, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _d, int _c, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _d, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _c, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _d, int _c, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _d, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(const VkImageMat& m) + : data(m.data), refcount(m.refcount), elemsize(m.elemsize), elempack(m.elempack), allocator(m.allocator), dims(m.dims), w(m.w), h(m.h), d(m.d), c(m.c) +{ + addref(); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, VkImageMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, VkImageMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _c, VkImageMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _d, int _c, VkImageMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, VkImageMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, VkImageMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _c, VkImageMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _d, int _c, VkImageMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ +} + +NCNN_FORCEINLINE VkImageMat::~VkImageMat() +{ + release(); +} + +NCNN_FORCEINLINE VkImageMat& VkImageMat::operator=(const VkImageMat& m) +{ + if (this == &m) + return *this; + + if (m.refcount) + NCNN_XADD(m.refcount, 1); + + release(); + + data = m.data; + refcount = m.refcount; + elemsize = m.elemsize; + elempack = m.elempack; + allocator = m.allocator; + + dims = m.dims; + w = m.w; + h = m.h; + d = m.d; + c = m.c; + + return *this; +} + +NCNN_FORCEINLINE Mat VkImageMat::mapped() const +{ + if (!allocator->mappable || !data->mapped_ptr) + return Mat(); + + if (dims == 1) + return Mat(w, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 2) + return Mat(w, h, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 3) + return Mat(w, h, c, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 4) + return Mat(w, h, d, c, mapped_ptr(), elemsize, elempack, 0); + + return Mat(); +} + +NCNN_FORCEINLINE void* VkImageMat::mapped_ptr() const +{ + if (!allocator->mappable || !data->mapped_ptr) + return 0; + + return (unsigned char*)data->mapped_ptr + data->bind_offset; +} + +NCNN_FORCEINLINE void VkImageMat::addref() +{ + if (refcount) + NCNN_XADD(refcount, 1); +} + +NCNN_FORCEINLINE void VkImageMat::release() +{ + if (refcount && NCNN_XADD(refcount, -1) == 1) + { + if (allocator && data) + { + allocator->fastFree(data); + } + } + + data = 0; + + elemsize = 0; + elempack = 0; + + dims = 0; + w = 0; + h = 0; + d = 0; + c = 0; + + refcount = 0; +} + +NCNN_FORCEINLINE bool VkImageMat::empty() const +{ + return data == 0 || total() == 0; +} + +NCNN_FORCEINLINE size_t VkImageMat::total() const +{ + return w * h * d * c; +} + +NCNN_FORCEINLINE int VkImageMat::elembits() const +{ + return elempack ? static_cast(elemsize) * 8 / elempack : 0; +} + +NCNN_FORCEINLINE Mat VkImageMat::shape() const +{ + if (dims == 1) + return Mat(w * elempack, (void*)0); + if (dims == 2) + return Mat(w, h * elempack, (void*)0); + if (dims == 3) + return Mat(w, h, c * elempack, (void*)0); + if (dims == 4) + return Mat(w, h, d, c * elempack, (void*)0); + + return Mat(); +} + +NCNN_FORCEINLINE VkImage VkImageMat::image() const +{ + return data->image; +} + +NCNN_FORCEINLINE VkImageView VkImageMat::imageview() const +{ + return data->imageview; +} + +#endif // NCNN_VULKAN + +} // namespace ncnn + +#endif // NCNN_MAT_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/modelbin.h b/app/libs/ncnn/arm64-v8a/include/ncnn/modelbin.h new file mode 100644 index 0000000..2b31e2e --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/modelbin.h @@ -0,0 +1,69 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_MODELBIN_H +#define NCNN_MODELBIN_H + +#include "mat.h" + +namespace ncnn { + +class DataReader; +class NCNN_EXPORT ModelBin +{ +public: + ModelBin(); + virtual ~ModelBin(); + // element type + // 0 = auto + // 1 = float32 + // 2 = float16 + // 3 = int8 + // load vec + virtual Mat load(int w, int type) const; + // load image + virtual Mat load(int w, int h, int type) const; + // load dim + virtual Mat load(int w, int h, int c, int type) const; + // load cube + virtual Mat load(int w, int h, int d, int c, int type) const; +}; + +class ModelBinFromDataReaderPrivate; +class NCNN_EXPORT ModelBinFromDataReader : public ModelBin +{ +public: + explicit ModelBinFromDataReader(const DataReader& dr); + virtual ~ModelBinFromDataReader(); + + virtual Mat load(int w, int type) const; + +private: + ModelBinFromDataReader(const ModelBinFromDataReader&); + ModelBinFromDataReader& operator=(const ModelBinFromDataReader&); + +private: + ModelBinFromDataReaderPrivate* const d; +}; + +class ModelBinFromMatArrayPrivate; +class NCNN_EXPORT ModelBinFromMatArray : public ModelBin +{ +public: + // construct from weight blob array + explicit ModelBinFromMatArray(const Mat* weights); + virtual ~ModelBinFromMatArray(); + + virtual Mat load(int w, int type) const; + +private: + ModelBinFromMatArray(const ModelBinFromMatArray&); + ModelBinFromMatArray& operator=(const ModelBinFromMatArray&); + +private: + ModelBinFromMatArrayPrivate* const d; +}; + +} // namespace ncnn + +#endif // NCNN_MODELBIN_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/ncnn_export.h b/app/libs/ncnn/arm64-v8a/include/ncnn/ncnn_export.h new file mode 100644 index 0000000..594a005 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/ncnn_export.h @@ -0,0 +1,43 @@ + +#ifndef NCNN_EXPORT_H +#define NCNN_EXPORT_H + +#ifdef NCNN_STATIC_DEFINE +# define NCNN_EXPORT +# define NCNN_NO_EXPORT +#else +# ifndef NCNN_EXPORT +# ifdef ncnn_EXPORTS + /* We are building this library */ +# define NCNN_EXPORT +# else + /* We are using this library */ +# define NCNN_EXPORT +# endif +# endif + +# ifndef NCNN_NO_EXPORT +# define NCNN_NO_EXPORT +# endif +#endif + +#ifndef NCNN_DEPRECATED +# define NCNN_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef NCNN_DEPRECATED_EXPORT +# define NCNN_DEPRECATED_EXPORT NCNN_EXPORT NCNN_DEPRECATED +#endif + +#ifndef NCNN_DEPRECATED_NO_EXPORT +# define NCNN_DEPRECATED_NO_EXPORT NCNN_NO_EXPORT NCNN_DEPRECATED +#endif + +/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */ +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef NCNN_NO_DEPRECATED +# define NCNN_NO_DEPRECATED +# endif +#endif + +#endif /* NCNN_EXPORT_H */ diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/net.h b/app/libs/ncnn/arm64-v8a/include/ncnn/net.h new file mode 100644 index 0000000..ae3deae --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/net.h @@ -0,0 +1,252 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_NET_H +#define NCNN_NET_H + +#include "blob.h" +#include "layer.h" +#include "mat.h" +#include "option.h" +#include "platform.h" + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 +#include +#endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API + +namespace ncnn { + +#if NCNN_VULKAN +class VkCompute; +#endif // NCNN_VULKAN +class DataReader; +class Extractor; +class NetPrivate; +class NCNN_EXPORT Net +{ +public: + // empty init + Net(); + // clear and destroy + virtual ~Net(); + +public: + // option can be changed before loading + Option opt; + +#if NCNN_VULKAN + // set gpu device by index + void set_vulkan_device(int device_index); + + // set gpu device by device handle, no owner transfer + void set_vulkan_device(const VulkanDevice* vkdev); + + const VulkanDevice* vulkan_device() const; +#endif // NCNN_VULKAN + +#if NCNN_STRING + // register custom layer or overwrite built-in layer by layer type name + // return 0 if success + int register_custom_layer(const char* type, layer_creator_func creator, layer_destroyer_func destroyer = 0, void* userdata = 0); + virtual int custom_layer_to_index(const char* type); +#endif // NCNN_STRING + // register custom layer or overwrite built-in layer by layer type + // return 0 if success + int register_custom_layer(int index, layer_creator_func creator, layer_destroyer_func destroyer = 0, void* userdata = 0); + +#if NCNN_STRING + int load_param(const DataReader& dr); +#endif // NCNN_STRING + + int load_param_bin(const DataReader& dr); + + int load_model(const DataReader& dr); + +#if NCNN_STDIO +#if NCNN_STRING + // load network structure from plain param file + // return 0 if success + int load_param(FILE* fp); + int load_param(const char* protopath); +#if _WIN32 + int load_param(const wchar_t* protopath); +#endif + + // load network structure from in-memory plain param string, must be NULL-terminated + // return 0 if success + int load_param_mem(const char* mem); +#endif // NCNN_STRING + // load network structure from binary param file + // return 0 if success + int load_param_bin(FILE* fp); + int load_param_bin(const char* protopath); +#if _WIN32 + int load_param_bin(const wchar_t* protopath); +#endif + + // load network weight data from model file + // return 0 if success + int load_model(FILE* fp); + int load_model(const char* modelpath); +#if _WIN32 + int load_model(const wchar_t* modelpath); +#endif +#endif // NCNN_STDIO + + // load network structure from external memory + // memory pointer must be 32-bit aligned + // return bytes consumed + size_t load_param(const unsigned char* mem); + + // reference network weight data from external memory + // weight data is not copied but referenced + // so external memory should be retained when used + // memory pointer must be 32-bit aligned + // return bytes consumed + size_t load_model(const unsigned char* mem); + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 +#if NCNN_STRING + // convenient load network structure from android asset plain param file + int load_param(AAsset* asset); + int load_param(AAssetManager* mgr, const char* assetpath); +#endif // NCNN_STRING + // convenient load network structure from android asset binary param file + int load_param_bin(AAsset* asset); + int load_param_bin(AAssetManager* mgr, const char* assetpath); + + // convenient load network weight data from android asset model file + int load_model(AAsset* asset); + int load_model(AAssetManager* mgr, const char* assetpath); +#endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API + + // unload network structure and weight data + void clear(); + + // construct an Extractor from network + Extractor create_extractor() const; + + // get input/output indexes/names + const std::vector& input_indexes() const; + const std::vector& output_indexes() const; +#if NCNN_STRING + const std::vector& input_names() const; + const std::vector& output_names() const; +#endif + + const std::vector& blobs() const; + const std::vector& layers() const; + + std::vector& mutable_blobs(); + std::vector& mutable_layers(); + +protected: + friend class Extractor; +#if NCNN_STRING + int find_blob_index_by_name(const char* name) const; + int find_layer_index_by_name(const char* name) const; + virtual Layer* create_custom_layer(const char* type); + virtual Layer* create_overwrite_builtin_layer(const char* type); +#endif // NCNN_STRING + virtual Layer* create_custom_layer(int index); + virtual Layer* create_overwrite_builtin_layer(int typeindex); + +private: + Net(const Net&); + Net& operator=(const Net&); + +private: + NetPrivate* const d; +}; + +class ExtractorPrivate; +class NCNN_EXPORT Extractor +{ +public: + virtual ~Extractor(); + + // copy + Extractor(const Extractor&); + + // assign + Extractor& operator=(const Extractor&); + + // clear blob mats and alloctors + void clear(); + + // enable light mode + // intermediate blob will be recycled when enabled + // enabled by default + void set_light_mode(bool enable); + + // set blob memory allocator + void set_blob_allocator(Allocator* allocator); + + // set workspace memory allocator + void set_workspace_allocator(Allocator* allocator); + +#if NCNN_VULKAN + void set_blob_vkallocator(VkAllocator* allocator); + + void set_workspace_vkallocator(VkAllocator* allocator); + + void set_staging_vkallocator(VkAllocator* allocator); +#endif // NCNN_VULKAN + +#if NCNN_STRING + // set input by blob name + // return 0 if success + int input(const char* blob_name, const Mat& in); + + // get result by blob name + // return 0 if success + // type = 0, default + // type = 1, do not convert fp16/bf16 or / and packing + int extract(const char* blob_name, Mat& feat, int type = 0); +#endif // NCNN_STRING + + // set input by blob index + // return 0 if success + int input(int blob_index, const Mat& in); + + // get result by blob index + // return 0 if success + // type = 0, default + // type = 1, do not convert fp16/bf16 or / and packing + int extract(int blob_index, Mat& feat, int type = 0); + +#if NCNN_VULKAN +#if NCNN_STRING + // set input by blob name + // return 0 if success + int input(const char* blob_name, const VkMat& in); + + // get result by blob name + // return 0 if success + int extract(const char* blob_name, VkMat& feat, VkCompute& cmd); +#endif // NCNN_STRING + + // set input by blob index + // return 0 if success + int input(int blob_index, const VkMat& in); + + // get result by blob index + // return 0 if success + int extract(int blob_index, VkMat& feat, VkCompute& cmd); +#endif // NCNN_VULKAN + +protected: + friend Extractor Net::create_extractor() const; + Extractor(const Net* net, size_t blob_count); + +private: + ExtractorPrivate* const d; +}; + +} // namespace ncnn + +#endif // NCNN_NET_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/option.h b/app/libs/ncnn/arm64-v8a/include/ncnn/option.h new file mode 100644 index 0000000..b65cb57 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/option.h @@ -0,0 +1,155 @@ +// Copyright 2019 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_OPTION_H +#define NCNN_OPTION_H + +#include "platform.h" + +namespace ncnn { + +#if NCNN_VULKAN +class VkAllocator; +class PipelineCache; +#endif // NCNN_VULKAN + +class Allocator; +class NCNN_EXPORT Option +{ +public: + // default option + Option(); + +public: + // light mode + // intermediate blob will be recycled when enabled + // enabled by default + bool lightmode; + + bool use_reserved_m0; + + // enable subgroup in shader + bool use_subgroup_ops; + + bool use_reserved_0; + + // thread count + // default value is the one returned by get_cpu_count() + int num_threads; + + // blob memory allocator + Allocator* blob_allocator; + + // workspace memory allocator + Allocator* workspace_allocator; + +#if NCNN_VULKAN + // blob memory allocator + VkAllocator* blob_vkallocator; + + // workspace memory allocator + VkAllocator* workspace_vkallocator; + + // staging memory allocator + VkAllocator* staging_vkallocator; + + // pipeline cache + PipelineCache* pipeline_cache; +#endif // NCNN_VULKAN + + // the time openmp threads busy-wait for more work before going to sleep + // default value is 20ms to keep the cores enabled + // without too much extra power consumption afterwards + int openmp_blocktime; + + // enable winograd convolution optimization + // improve convolution 3x3 stride1 performance, may consume more memory + // changes should be applied before loading network structure and weight + // enabled by default + bool use_winograd_convolution; + + // enable sgemm convolution optimization + // improve convolution 1x1 stride1 performance, may consume more memory + // changes should be applied before loading network structure and weight + // enabled by default + bool use_sgemm_convolution; + + // enable quantized int8 inference + // use low-precision int8 path for quantized model + // changes should be applied before loading network structure and weight + // enabled by default + bool use_int8_inference; + + // enable vulkan compute + bool use_vulkan_compute; + + // enable bf16 data type for storage + // improve most operator performance on all arm devices, may consume more memory + bool use_bf16_storage; + + // enable options for gpu inference + bool use_fp16_packed; + bool use_fp16_storage; + bool use_fp16_arithmetic; + bool use_int8_packed; + bool use_int8_storage; + bool use_int8_arithmetic; + + // enable simd-friendly packed memory layout + // improve all operator performance on all arm devices, will consume more memory + // changes should be applied before loading network structure and weight + // enabled by default + bool use_packing_layout; + + // the vulkan device + int vulkan_device_index; + + // enable options for gpu inference + bool use_bf16_packed; + + bool use_tensor_storage; + + bool use_reserved_1p; + bool use_weights_in_host_memory; + + // enable DAZ(Denormals-Are-Zero) and FTZ(Flush-To-Zero) + // default value is 3 + // 0 = DAZ OFF, FTZ OFF + // 1 = DAZ ON , FTZ OFF + // 2 = DAZ OFF, FTZ ON + // 3 = DAZ ON, FTZ ON + unsigned char flush_denormals; + + bool use_reserved_2f; + bool use_reserved_3f; + bool use_mapped_model_loading; + + bool use_local_pool_allocator; + + // enable local memory optimization for gpu inference + bool use_shader_local_memory; + + // enable cooperative matrix optimization for gpu inference + bool use_cooperative_matrix; + + // more fine-grained control of winograd convolution + bool use_winograd23_convolution; + bool use_winograd43_convolution; + bool use_winograd63_convolution; + + // this option is turned on for A53/A55 automatically + // but you can force this on/off if you wish + bool use_a53_a55_optimized_kernel; + + // enable options for shared variables in gpu shader + bool use_fp16_uniform; + bool use_int8_uniform; + + bool use_reserved_9; + bool use_reserved_10; + bool use_reserved_11; +}; + +} // namespace ncnn + +#endif // NCNN_OPTION_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/paramdict.h b/app/libs/ncnn/arm64-v8a/include/ncnn/paramdict.h new file mode 100644 index 0000000..2acdb7a --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/paramdict.h @@ -0,0 +1,66 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_PARAMDICT_H +#define NCNN_PARAMDICT_H + +#include "mat.h" + +// at most 32 parameters +#define NCNN_MAX_PARAM_COUNT 32 + +namespace ncnn { + +class DataReader; +class Net; +class ParamDictPrivate; +class NCNN_EXPORT ParamDict +{ +public: + // empty + ParamDict(); + + virtual ~ParamDict(); + + // copy + ParamDict(const ParamDict&); + + // assign + ParamDict& operator=(const ParamDict&); + + // get type + int type(int id) const; + + // get int + int get(int id, int def) const; + // get float + float get(int id, float def) const; + // get array + Mat get(int id, const Mat& def) const; + // get string + std::string get(int id, const std::string& def) const; + + // set int + void set(int id, int i); + // set float + void set(int id, float f); + // set array + void set(int id, const Mat& v); + // set string + void set(int id, const std::string& s); + +protected: + friend class Net; + + void clear(); + + int load_param(const DataReader& dr); + int load_param_bin(const DataReader& dr); + +private: + ParamDictPrivate* const d; +}; + +} // namespace ncnn + +#endif // NCNN_PARAMDICT_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/pipeline.h b/app/libs/ncnn/arm64-v8a/include/ncnn/pipeline.h new file mode 100644 index 0000000..0a3a9ba --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/pipeline.h @@ -0,0 +1,101 @@ +// Copyright 2019 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_PIPELINE_H +#define NCNN_PIPELINE_H + +#include "mat.h" +#include "platform.h" +#if NCNN_VULKAN +#include "gpu.h" +#endif // NCNN_VULKAN + +namespace ncnn { + +#if NCNN_VULKAN +class Option; +class PipelinePrivate; +class NCNN_EXPORT Pipeline +{ +public: + explicit Pipeline(const VulkanDevice* vkdev); + virtual ~Pipeline(); + +public: + void set_optimal_local_size_xyz(int w = 4, int h = 4, int c = 4); + void set_optimal_local_size_xyz(const Mat& local_size_xyz); + void set_local_size_xyz(int w, int h, int c); + void set_subgroup_size(uint32_t subgroup_size); + + int create(const uint32_t* spv_data, size_t spv_data_size, const std::vector& specializations); + + int create(int shader_type_index, const Option& opt, const std::vector& specializations); + +public: + VkShaderModule shader_module() const; + VkDescriptorSetLayout descriptorset_layout() const; + VkPipelineLayout pipeline_layout() const; + VkPipeline pipeline() const; + VkDescriptorUpdateTemplateKHR descriptor_update_template() const; + + const ShaderInfo& shader_info() const; + + uint32_t local_size_x() const; + uint32_t local_size_y() const; + uint32_t local_size_z() const; + +protected: + void set_shader_module(VkShaderModule shader_module); + void set_descriptorset_layout(VkDescriptorSetLayout descriptorset_layout); + void set_pipeline_layout(VkPipelineLayout pipeline_layout); + void set_pipeline(VkPipeline pipeline); + void set_descriptor_update_template(VkDescriptorUpdateTemplateKHR descriptor_update_template); + + void set_shader_info(const ShaderInfo& shader_info); + +public: + const VulkanDevice* vkdev; + +private: + Pipeline(const Pipeline&); + Pipeline& operator=(const Pipeline&); + +private: + PipelinePrivate* const d; +}; + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 +class VkCompute; +class NCNN_EXPORT ImportAndroidHardwareBufferPipeline : private Pipeline +{ +public: + explicit ImportAndroidHardwareBufferPipeline(const VulkanDevice* vkdev); + virtual ~ImportAndroidHardwareBufferPipeline(); + + int create(VkAndroidHardwareBufferImageAllocator* ahb_im_allocator, int type_to, int rotate_from, const Option& opt); + int create(VkAndroidHardwareBufferImageAllocator* ahb_im_allocator, int type_to, int rotate_from, int target_width, int target_height, const Option& opt); + void destroy(); + + friend class VkCompute; + +protected: + int create_shader_module(const Option& opt); + int create_sampler(VkAndroidHardwareBufferImageAllocator* ahb_im_allocator); + int create_descriptorset_layout(); + +public: + int type_to; + int rotate_from; + bool need_resize; + + VkSampler sampler; +}; +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + +#endif // NCNN_VULKAN + +} // namespace ncnn + +#endif // NCNN_PIPELINE_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/pipelinecache.h b/app/libs/ncnn/arm64-v8a/include/ncnn/pipelinecache.h new file mode 100644 index 0000000..0edee22 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/pipelinecache.h @@ -0,0 +1,91 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_PIPELINECACHE_H +#define NCNN_PIPELINECACHE_H + +#include "platform.h" + +#include "mat.h" +#include "gpu.h" + +#if NCNN_STDIO +#include +#endif + +namespace ncnn { + +#if NCNN_VULKAN + +class VulkanDevice; +class PipelineCachePrivate; +class NCNN_EXPORT PipelineCache +{ +public: + explicit PipelineCache(const VulkanDevice* _vkdev); + + virtual ~PipelineCache(); + + void clear(); + size_t size() const; + + int save_cache(std::vector& data) const; + int load_cache(const unsigned char* data, size_t size) const; + int load_cache(const std::vector& data) const; + +#if NCNN_STDIO + int save_cache(FILE* fp) const; + int load_cache(FILE* fp) const; + int save_cache(const char* path) const; + int load_cache(const char* path) const; +#if _WIN32 + int save_cache(const wchar_t* path) const; + int load_cache(const wchar_t* path) const; +#endif // _WIN32 +#endif // NCNN_STDIO + + int get_pipeline(const uint32_t* spv_data, size_t spv_data_size, const std::vector& specializations, + uint32_t local_size_x, uint32_t local_size_y, uint32_t local_size_z, uint32_t subgroup_size, + VkShaderModule* shader_module, + VkDescriptorSetLayout* descriptorset_layout, + VkPipelineLayout* pipeline_layout, + VkPipeline* pipeline, + VkDescriptorUpdateTemplateKHR* descriptor_update_template, + ShaderInfo& shader_info) const; + + int get_pipeline(int shader_type_index, const Option& opt, const std::vector& specializations, + uint32_t local_size_x, uint32_t local_size_y, uint32_t local_size_z, uint32_t subgroup_size, + VkShaderModule* shader_module, + VkDescriptorSetLayout* descriptorset_layout, + VkPipelineLayout* pipeline_layout, + VkPipeline* pipeline, + VkDescriptorUpdateTemplateKHR* descriptor_update_template, + ShaderInfo& shader_info) const; + +protected: + int create_shader_module(int shader_type_index, const Option& opt, + uint32_t local_size_x, uint32_t local_size_y, uint32_t local_size_z, + VkShaderModule* _shader_module, ShaderInfo& si) const; + + int new_pipeline(VkShaderModule shader_module, const ShaderInfo& shader_info, const std::vector& specializations, uint32_t subgroup_size, + VkDescriptorSetLayout* descriptorset_layout, + VkPipelineLayout* pipeline_layout, + VkPipeline* pipeline, + VkDescriptorUpdateTemplateKHR* descriptor_update_template) const; + +protected: + const VulkanDevice* vkdev; + +private: + PipelineCache(const PipelineCache&); + PipelineCache& operator=(const PipelineCache&); + +private: + PipelineCachePrivate* const d; +}; + +#endif // NCNN_VULKAN + +} // namespace ncnn + +#endif // NCNN_PIPELINECACHE_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/platform.h b/app/libs/ncnn/arm64-v8a/include/ncnn/platform.h new file mode 100644 index 0000000..9bccefa --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/platform.h @@ -0,0 +1,495 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_PLATFORM_H +#define NCNN_PLATFORM_H + +#define NCNN_STDIO 1 +#define NCNN_STRING 1 +#define NCNN_SIMPLEOCV 0 +#define NCNN_SIMPLEOMP 0 +#define NCNN_SIMPLESTL 0 +#define NCNN_SIMPLEMATH 0 +#define NCNN_THREADS 1 +#define NCNN_BENCHMARK 0 +#define NCNN_C_API 1 +#define NCNN_PLATFORM_API 1 +#define NCNN_WINXP 0 +#define NCNN_PIXEL 1 +#define NCNN_PIXEL_ROTATE 1 +#define NCNN_PIXEL_AFFINE 1 +#define NCNN_PIXEL_DRAWING 1 +#define NCNN_VULKAN 1 +#define NCNN_SIMPLEVK 1 +#define NCNN_SYSTEM_GLSLANG 0 +#define NCNN_RUNTIME_CPU 1 +#define NCNN_GNU_INLINE_ASM 1 +#define NCNN_AVX 0 +#define NCNN_XOP 0 +#define NCNN_FMA 0 +#define NCNN_F16C 0 +#define NCNN_AVX2 0 +#define NCNN_AVXVNNI 0 +#define NCNN_AVXVNNIINT8 0 +#define NCNN_AVXVNNIINT16 0 +#define NCNN_AVXNECONVERT 0 +#define NCNN_AVX512 0 +#define NCNN_AVX512VNNI 0 +#define NCNN_AVX512BF16 0 +#define NCNN_AVX512FP16 0 +#define NCNN_VFPV4 1 +#define NCNN_ARM82 1 +#define NCNN_ARM82DOT 1 +#define NCNN_ARM82FP16FML 1 +#define NCNN_ARM84BF16 1 +#define NCNN_ARM84I8MM 1 +#define NCNN_ARM86SVE 1 +#define NCNN_ARM86SVE2 1 +#define NCNN_ARM86SVEBF16 1 +#define NCNN_ARM86SVEI8MM 1 +#define NCNN_ARM86SVEF32MM 1 +#define NCNN_MSA 0 +#define NCNN_LSX 0 +#define NCNN_LASX 0 +#define NCNN_MMI 0 +#define NCNN_RVV 0 +#define NCNN_ZFH 0 +#define NCNN_ZVFH 0 +#define NCNN_XTHEADVECTOR 0 +#define NCNN_INT8 1 +#define NCNN_BF16 1 +#define NCNN_FORCE_INLINE 1 + +#define NCNN_VERSION_STRING "1.0.20260526" +#define NCNN_VERSION_NUMBER 20260526 + +#include "ncnn_export.h" + +#ifdef __cplusplus + +#if defined _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#elif defined __ANDROID__ || defined __OHOS__ || defined __linux__ || __APPLE__ +#include +#include +#include +#include +#include +#endif + +#if NCNN_THREADS +#if defined _WIN32 +#include +#else +#include +#endif +#endif // NCNN_THREADS + +#if __ANDROID_API__ >= 26 +#ifndef VK_USE_PLATFORM_ANDROID_KHR +#define VK_USE_PLATFORM_ANDROID_KHR +#endif +#endif // __ANDROID_API__ >= 26 + +#include + +namespace ncnn { + +#if NCNN_THREADS +#if defined _WIN32 +#if NCNN_WINXP +class NCNN_EXPORT Mutex +{ +public: + Mutex() { InitializeCriticalSection(&cs); } + ~Mutex() { DeleteCriticalSection(&cs); } + void lock() { EnterCriticalSection(&cs); } + void unlock() { LeaveCriticalSection(&cs); } +private: + friend class ConditionVariable; + CRITICAL_SECTION cs; +}; + +class NCNN_EXPORT ConditionVariable +{ +public: + ConditionVariable() + { + signal_event = CreateEvent(0, FALSE, FALSE, 0); // Auto-reset event for signal() + broadcast_event = CreateEvent(0, TRUE, FALSE, 0); // Manual-reset event for broadcast() + } + ~ConditionVariable() + { + CloseHandle(signal_event); + CloseHandle(broadcast_event); + } + void wait(Mutex& mutex) + { + mutex.unlock(); + HANDLE events[2] = { signal_event, broadcast_event }; + WaitForMultipleObjects(2, events, FALSE, INFINITE); // Wait for either signal or broadcast + mutex.lock(); + } + void broadcast() + { + SetEvent(broadcast_event); // Wake all threads + ResetEvent(broadcast_event); // Reset after waking all threads + } + void signal() + { + SetEvent(signal_event); // Wake one thread + } +private: + HANDLE signal_event; + HANDLE broadcast_event; +}; +#else // NCNN_WINXP +class NCNN_EXPORT Mutex +{ +public: + Mutex() { InitializeSRWLock(&srwlock); } + ~Mutex() {} + void lock() { AcquireSRWLockExclusive(&srwlock); } + void unlock() { ReleaseSRWLockExclusive(&srwlock); } +private: + friend class ConditionVariable; + SRWLOCK srwlock; +}; + +class NCNN_EXPORT ConditionVariable +{ +public: + ConditionVariable() { InitializeConditionVariable(&condvar); } + ~ConditionVariable() {} + void wait(Mutex& mutex) { SleepConditionVariableSRW(&condvar, &mutex.srwlock, INFINITE, 0); } + void broadcast() { WakeAllConditionVariable(&condvar); } + void signal() { WakeConditionVariable(&condvar); } +private: + CONDITION_VARIABLE condvar; +}; +#endif // NCNN_WINXP + +static unsigned __stdcall start_wrapper(void* args); +class NCNN_EXPORT Thread +{ +public: + Thread(void* (*start)(void*), void* args = 0) { _start = start; _args = args; handle = (HANDLE)_beginthreadex(0, 0, start_wrapper, this, 0, 0); } + ~Thread() {} + void join() { WaitForSingleObject(handle, INFINITE); CloseHandle(handle); } +private: + friend unsigned __stdcall start_wrapper(void* args) + { + Thread* t = (Thread*)args; + t->_start(t->_args); + return 0; + } + HANDLE handle; + void* (*_start)(void*); + void* _args; +}; + +class NCNN_EXPORT ThreadLocalStorage +{ +public: + ThreadLocalStorage() { key = TlsAlloc(); } + ~ThreadLocalStorage() { TlsFree(key); } + void set(void* value) { TlsSetValue(key, (LPVOID)value); } + void* get() { return (void*)TlsGetValue(key); } +private: + DWORD key; +}; +#else // defined _WIN32 +class NCNN_EXPORT Mutex +{ +public: + Mutex() { pthread_mutex_init(&mutex, 0); } + ~Mutex() { pthread_mutex_destroy(&mutex); } + void lock() { pthread_mutex_lock(&mutex); } + void unlock() { pthread_mutex_unlock(&mutex); } +private: + friend class ConditionVariable; + pthread_mutex_t mutex; +}; + +class NCNN_EXPORT ConditionVariable +{ +public: + ConditionVariable() { pthread_cond_init(&cond, 0); } + ~ConditionVariable() { pthread_cond_destroy(&cond); } + void wait(Mutex& mutex) { pthread_cond_wait(&cond, &mutex.mutex); } + void broadcast() { pthread_cond_broadcast(&cond); } + void signal() { pthread_cond_signal(&cond); } +private: + pthread_cond_t cond; +}; + +class NCNN_EXPORT Thread +{ +public: + Thread(void* (*start)(void*), void* args = 0) { pthread_create(&t, 0, start, args); } + ~Thread() {} + void join() { pthread_join(t, 0); } +private: + pthread_t t; +}; + +class NCNN_EXPORT ThreadLocalStorage +{ +public: + ThreadLocalStorage() { pthread_key_create(&key, 0); } + ~ThreadLocalStorage() { pthread_key_delete(key); } + void set(void* value) { pthread_setspecific(key, value); } + void* get() { return pthread_getspecific(key); } +private: + pthread_key_t key; +}; +#endif // defined _WIN32 +#else // NCNN_THREADS +class NCNN_EXPORT Mutex +{ +public: + Mutex() {} + ~Mutex() {} + void lock() {} + void unlock() {} +}; + +class NCNN_EXPORT ConditionVariable +{ +public: + ConditionVariable() {} + ~ConditionVariable() {} + void wait(Mutex& /*mutex*/) {} + void broadcast() {} + void signal() {} +}; + +class NCNN_EXPORT Thread +{ +public: + Thread(void* (*/*start*/)(void*), void* /*args*/ = 0) {} + ~Thread() {} + void join() {} +}; + +class NCNN_EXPORT ThreadLocalStorage +{ +public: + ThreadLocalStorage() { data = 0; } + ~ThreadLocalStorage() {} + void set(void* value) { data = value; } + void* get() { return data; } +private: + void* data; +}; +#endif // NCNN_THREADS + +class NCNN_EXPORT MutexLockGuard +{ +public: + MutexLockGuard(Mutex& _mutex) : mutex(_mutex) { mutex.lock(); } + ~MutexLockGuard() { mutex.unlock(); } +private: + Mutex& mutex; +}; + +#if defined _WIN32 +class NCNN_EXPORT MappedFile +{ +public: + MappedFile() { ptr = 0; _size = 0; file = INVALID_HANDLE_VALUE; mapping = 0; } + ~MappedFile() { close(); } + int open(const char* path) + { + close(); + + file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (file == INVALID_HANDLE_VALUE) return -1; + + LARGE_INTEGER liSize; + if (!GetFileSizeEx(file, &liSize)) { close(); return -1; } + + _size = (size_t)liSize.QuadPart; + if (_size == 0) { close(); return -1; } + + mapping = CreateFileMapping(file, NULL, PAGE_READONLY, 0, 0, NULL); + if (!mapping) { close(); return -1; } + + ptr = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0); + if (!ptr) { close(); return -1; } + return 0; + } + int open(const wchar_t* path) + { + close(); + + file = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (file == INVALID_HANDLE_VALUE) return -1; + + LARGE_INTEGER liSize; + if (!GetFileSizeEx(file, &liSize)) { close(); return -1; } + + _size = (size_t)liSize.QuadPart; + if (_size == 0) { close(); return -1; } + + mapping = CreateFileMapping(file, NULL, PAGE_READONLY, 0, 0, NULL); + if (!mapping) { close(); return -1; } + + ptr = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0); + if (!ptr) { close(); return -1; } + return 0; + } + void close() + { + if (ptr) { UnmapViewOfFile(ptr); ptr = 0; } + if (mapping) { CloseHandle(mapping); mapping = 0; } + if (file != INVALID_HANDLE_VALUE) { CloseHandle(file); file = INVALID_HANDLE_VALUE; } + _size = 0; + } + const void* mapped_ptr() const { return ptr; } + size_t size() const { return _size; } +private: + void* ptr; + size_t _size; + HANDLE file; + HANDLE mapping; +}; +#elif defined __ANDROID__ || defined __OHOS__ || defined __linux__ || __APPLE__ +class NCNN_EXPORT MappedFile +{ +public: + MappedFile() { ptr = 0; _size = 0; fd = -1; } + ~MappedFile() { close(); } + int open(const char* path) + { + close(); + + fd = ::open(path, O_RDONLY); + if (fd < 0) return -1; + + struct stat st; + if (fstat(fd, &st) < 0) { close(); return -1; } + + _size = (size_t)st.st_size; + if (_size == 0) { close(); return -1; } + + ptr = mmap(NULL, _size, PROT_READ, MAP_PRIVATE, fd, 0); + if (ptr == MAP_FAILED) { close(); return -1; } + return 0; + } + void close() + { + if (ptr && ptr != MAP_FAILED) { munmap(ptr, _size); } + ptr = 0; + if (fd >= 0) { ::close(fd); fd = -1; } + _size = 0; + } + const void* mapped_ptr() const { return ptr; } + size_t size() const { return _size; } +private: + void* ptr; + size_t _size; + int fd; +}; +#else // defined _WIN32 || __ANDROID__ || defined __OHOS__ || defined __linux__ || __APPLE__ +class NCNN_EXPORT MappedFile +{ +public: + MappedFile() {} + ~MappedFile() {} + int open(const char* /*path*/) { return -1; } + void close() {} + const void* mapped_ptr() const { return 0; } + size_t size() const { return 0; } +}; +#endif // defined _WIN32 || __ANDROID__ || defined __OHOS__ || defined __linux__ || __APPLE__ + +static inline void swap_endianness_16(void* x) +{ + unsigned char* xx = (unsigned char*)x; + unsigned char x0 = xx[0]; + unsigned char x1 = xx[1]; + xx[0] = x1; + xx[1] = x0; +} + +static inline void swap_endianness_32(void* x) +{ + unsigned char* xx = (unsigned char*)x; + unsigned char x0 = xx[0]; + unsigned char x1 = xx[1]; + unsigned char x2 = xx[2]; + unsigned char x3 = xx[3]; + xx[0] = x3; + xx[1] = x2; + xx[2] = x1; + xx[3] = x0; +} + +} // namespace ncnn + +#if NCNN_SIMPLESTL +#include "simplestl.h" +#else +#include +#include +#include +#include +#include +#endif + +// simplemath +#if NCNN_SIMPLEMATH +#include "simplemath.h" +#else +#include +#include +#endif + +#if NCNN_VULKAN +#if NCNN_SIMPLEVK +#include "simplevk.h" +#else +#include +#endif +#include "vulkan_header_fix.h" +#endif // NCNN_VULKAN + +#endif // __cplusplus + +#if NCNN_STDIO +#if NCNN_PLATFORM_API && __ANDROID_API__ >= 8 +#include +#define NCNN_LOGE(...) do { \ + fprintf(stderr, ##__VA_ARGS__); fprintf(stderr, "\n"); \ + __android_log_print(ANDROID_LOG_WARN, "ncnn", ##__VA_ARGS__); } while(0) +#else // NCNN_PLATFORM_API && __ANDROID_API__ >= 8 +#include +#define NCNN_LOGE(...) do { \ + fprintf(stderr, ##__VA_ARGS__); fprintf(stderr, "\n"); } while(0) +#endif // NCNN_PLATFORM_API && __ANDROID_API__ >= 8 +#else +#define NCNN_LOGE(...) +#endif + + +#if NCNN_FORCE_INLINE +#ifdef _MSC_VER + #define NCNN_FORCEINLINE __forceinline +#elif defined(__GNUC__) + #define NCNN_FORCEINLINE inline __attribute__((__always_inline__)) +#elif defined(__CLANG__) + #if __has_attribute(__always_inline__) + #define NCNN_FORCEINLINE inline __attribute__((__always_inline__)) + #else + #define NCNN_FORCEINLINE inline + #endif +#else + #define NCNN_FORCEINLINE inline +#endif +#else + #define NCNN_FORCEINLINE inline +#endif + +#endif // NCNN_PLATFORM_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/simplemath.h b/app/libs/ncnn/arm64-v8a/include/ncnn/simplemath.h new file mode 100644 index 0000000..8c5fb8c --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/simplemath.h @@ -0,0 +1,106 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_SIMPLEMATH_H +#define NCNN_SIMPLEMATH_H + +#include "platform.h" + +#if NCNN_SIMPLEMATH + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef INFINITY +#define INFINITY (1.0f / 0.0f) +#endif + +/* +* ==================================================== +* discrete functions +* ==================================================== +*/ +NCNN_EXPORT float fabs(float); +NCNN_EXPORT float fabsf(float); +NCNN_EXPORT float fmod(float, float); +NCNN_EXPORT float floor(float); +NCNN_EXPORT float floorf(float); +NCNN_EXPORT float round(float); +NCNN_EXPORT float roundf(float); +NCNN_EXPORT float ceil(float); +NCNN_EXPORT float ceilf(float); +NCNN_EXPORT float fmaxf(float, float); +NCNN_EXPORT float truncf(float); +NCNN_EXPORT float frac(float); +NCNN_EXPORT float fmodf(float, float); +NCNN_EXPORT float remainderf(float, float); +/* +* ==================================================== +* trigonometric functions +* ==================================================== +*/ +NCNN_EXPORT float sinf(float); +NCNN_EXPORT float cosf(float); +NCNN_EXPORT float tanf(float); +NCNN_EXPORT float asinf(float); +NCNN_EXPORT float acosf(float); +NCNN_EXPORT float atanf(float); +NCNN_EXPORT float atan2f(float, float); +NCNN_EXPORT float sinhf(float); +NCNN_EXPORT float coshf(float); +NCNN_EXPORT float tanhf(float); +NCNN_EXPORT float asinhf(float); +NCNN_EXPORT float acoshf(float); +NCNN_EXPORT float atanhf(float); + +/* +* ==================================================== +* power functions +* ==================================================== +*/ +NCNN_EXPORT float sqrtf(float); +NCNN_EXPORT float sqrt(float); +NCNN_EXPORT float powf(float, float); + +/* +* ==================================================== +* exponential and logarithm functions +* ==================================================== +*/ +NCNN_EXPORT float expf(float); +NCNN_EXPORT float expm1f(float); +NCNN_EXPORT float frexp(float, int*); +NCNN_EXPORT float logf(float); +NCNN_EXPORT float log(float); +NCNN_EXPORT float log10f(float); +NCNN_EXPORT float log1pf(float); + +/* +* ==================================================== +* probability functions +* ==================================================== +*/ +NCNN_EXPORT float erf(float); +NCNN_EXPORT float erff(float); +NCNN_EXPORT float erfcf(float); + +/* +* ==================================================== +* other functions +* ==================================================== +*/ +NCNN_EXPORT int msb(unsigned int); +NCNN_EXPORT float fmaf(float, float, float); +NCNN_EXPORT float copysignf(float, float); +NCNN_EXPORT void fesetround(int); +NCNN_EXPORT int fegetround(); +NCNN_EXPORT float nearbyintf(float); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // NCNN_SIMPLEMATH + +#endif // NCNN_SIMPLEMATH_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/simpleocv.h b/app/libs/ncnn/arm64-v8a/include/ncnn/simpleocv.h new file mode 100644 index 0000000..650e520 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/simpleocv.h @@ -0,0 +1,492 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_SIMPLEOCV_H +#define NCNN_SIMPLEOCV_H + +#include "platform.h" + +#if NCNN_SIMPLEOCV + +#include +#include +#include "allocator.h" +#include "mat.h" + +#if defined(_MSC_VER) || defined(__GNUC__) +#pragma push_macro("min") +#pragma push_macro("max") +#undef min +#undef max +#endif + +#ifndef NCNN_XADD +using ncnn::NCNN_XADD; +#endif + +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; + +enum +{ + CV_LOAD_IMAGE_UNCHANGED = -1, + CV_LOAD_IMAGE_GRAYSCALE = 0, + CV_LOAD_IMAGE_COLOR = 1, +}; + +enum +{ + CV_IMWRITE_JPEG_QUALITY = 1 +}; + +// minimal opencv style data structure implementation +namespace cv { + +template +static inline _Tp saturate_cast(int v) +{ + return _Tp(v); +} +template<> +inline uchar saturate_cast(int v) +{ + return (uchar)((unsigned)v <= UCHAR_MAX ? v : v > 0 ? UCHAR_MAX : 0); +} + +template +struct Scalar_ +{ + Scalar_() + { + v[0] = 0; + v[1] = 0; + v[2] = 0; + v[3] = 0; + } + Scalar_(_Tp _v0) + { + v[0] = _v0; + v[1] = 0; + v[2] = 0; + v[3] = 0; + } + Scalar_(_Tp _v0, _Tp _v1, _Tp _v2) + { + v[0] = _v0; + v[1] = _v1; + v[2] = _v2; + v[3] = 0; + } + Scalar_(_Tp _v0, _Tp _v1, _Tp _v2, _Tp _v3) + { + v[0] = _v0; + v[1] = _v1; + v[2] = _v2; + v[3] = _v3; + } + + const _Tp operator[](const int i) const + { + return v[i]; + } + + _Tp operator[](const int i) + { + return v[i]; + } + + _Tp v[4]; +}; + +typedef Scalar_ Scalar; + +template +struct Point_ +{ + Point_() + : x(0), y(0) + { + } + Point_(_Tp _x, _Tp _y) + : x(_x), y(_y) + { + } + + template + operator Point_<_Tp2>() const + { + return Point_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y)); + } + + _Tp x; + _Tp y; +}; + +typedef Point_ Point; +typedef Point_ Point2f; + +template +struct Size_ +{ + Size_() + : width(0), height(0) + { + } + Size_(_Tp _w, _Tp _h) + : width(_w), height(_h) + { + } + + template + operator Size_<_Tp2>() const + { + return Size_<_Tp2>(saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height)); + } + + _Tp width; + _Tp height; +}; + +typedef Size_ Size; +typedef Size_ Size2f; + +template +struct Rect_ +{ + Rect_() + : x(0), y(0), width(0), height(0) + { + } + Rect_(_Tp _x, _Tp _y, _Tp _w, _Tp _h) + : x(_x), y(_y), width(_w), height(_h) + { + } + Rect_(Point_<_Tp> _p, Size_<_Tp> _size) + : x(_p.x), y(_p.y), width(_size.width), height(_size.height) + { + } + + template + operator Rect_<_Tp2>() const + { + return Rect_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y), saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height)); + } + + _Tp x; + _Tp y; + _Tp width; + _Tp height; + + // area + _Tp area() const + { + return width * height; + } +}; + +template +static inline Rect_<_Tp>& operator&=(Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + _Tp x1 = std::max(a.x, b.x), y1 = std::max(a.y, b.y); + a.width = std::min(a.x + a.width, b.x + b.width) - x1; + a.height = std::min(a.y + a.height, b.y + b.height) - y1; + a.x = x1; + a.y = y1; + if (a.width <= 0 || a.height <= 0) + a = Rect_<_Tp>(); + return a; +} + +template +static inline Rect_<_Tp>& operator|=(Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + _Tp x1 = std::min(a.x, b.x), y1 = std::min(a.y, b.y); + a.width = std::max(a.x + a.width, b.x + b.width) - x1; + a.height = std::max(a.y + a.height, b.y + b.height) - y1; + a.x = x1; + a.y = y1; + return a; +} + +template +static inline Rect_<_Tp> operator&(const Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + Rect_<_Tp> c = a; + return c &= b; +} + +template +static inline Rect_<_Tp> operator|(const Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + Rect_<_Tp> c = a; + return c |= b; +} + +typedef Rect_ Rect; +typedef Rect_ Rect2f; + +#define CV_8UC1 1 +#define CV_8UC3 3 +#define CV_8UC4 4 +#define CV_32FC1 4 + +struct NCNN_EXPORT Mat +{ + Mat() + : data(0), refcount(0), rows(0), cols(0), c(0) + { + } + + Mat(int _rows, int _cols, int flags) + : data(0), refcount(0) + { + create(_rows, _cols, flags); + } + + // copy + Mat(const Mat& m) + : data(m.data), refcount(m.refcount) + { + if (refcount) + NCNN_XADD(refcount, 1); + + rows = m.rows; + cols = m.cols; + c = m.c; + } + + Mat(int _rows, int _cols, int flags, void* _data) + : data((unsigned char*)_data), refcount(0) + { + rows = _rows; + cols = _cols; + c = flags; + } + + ~Mat() + { + release(); + } + + // assign + Mat& operator=(const Mat& m) + { + if (this == &m) + return *this; + + if (m.refcount) + NCNN_XADD(m.refcount, 1); + + release(); + + data = m.data; + refcount = m.refcount; + + rows = m.rows; + cols = m.cols; + c = m.c; + + return *this; + } + + Mat& operator=(const Scalar& s) + { + if (total() > 0) + { + uchar* p = data; + for (int i = 0; i < cols * rows; i++) + { + for (int j = 0; j < c; j++) + { + *p++ = s[j]; + } + } + } + + return *this; + } + + void create(int _rows, int _cols, int flags) + { + release(); + + rows = _rows; + cols = _cols; + c = flags; + + if (total() > 0) + { + // refcount address must be aligned, so we expand totalsize here + size_t totalsize = (total() + 3) >> 2 << 2; + data = (uchar*)ncnn::fastMalloc(totalsize + (int)sizeof(*refcount)); + refcount = (int*)(((uchar*)data) + totalsize); + *refcount = 1; + } + } + + void release() + { + if (refcount && NCNN_XADD(refcount, -1) == 1) + ncnn::fastFree(data); + + data = 0; + + rows = 0; + cols = 0; + c = 0; + + refcount = 0; + } + + Mat clone() const + { + if (empty()) + return Mat(); + + Mat m(rows, cols, c); + + if (total() > 0) + { + memcpy(m.data, data, total()); + } + + return m; + } + + bool empty() const + { + return data == 0 || total() == 0; + } + + int channels() const + { + return c; + } + + int type() const + { + return c; + } + + size_t total() const + { + return cols * rows * c; + } + + const uchar* ptr(int y) const + { + return data + y * cols * c; + } + + uchar* ptr(int y) + { + return data + y * cols * c; + } + + template + const _Tp* ptr(int y) const + { + return (const _Tp*)(data + y * cols * c); + } + + template + _Tp* ptr(int y) + { + return (_Tp*)(data + y * cols * c); + } + + // roi + Mat operator()(const Rect& roi) const + { + if (empty()) + return Mat(); + + Mat m(roi.height, roi.width, c); + + int sy = roi.y; + for (int y = 0; y < roi.height; y++) + { + const uchar* sptr = ptr(sy) + roi.x * c; + uchar* dptr = m.ptr(y); + memcpy(dptr, sptr, roi.width * c); + sy++; + } + + return m; + } + + uchar* data; + + // pointer to the reference counter; + // when points to user-allocated data, the pointer is NULL + int* refcount; + + int rows; + int cols; + + int c; +}; + +enum ImreadModes +{ + IMREAD_UNCHANGED = -1, + IMREAD_GRAYSCALE = 0, + IMREAD_COLOR = 1 +}; + +NCNN_EXPORT Mat imread(const std::string& path, int flags = IMREAD_COLOR); + +NCNN_EXPORT Mat imdecode(const std::vector& buf, int flags = IMREAD_COLOR); + +enum ImwriteFlags +{ + IMWRITE_JPEG_QUALITY = 1 +}; + +NCNN_EXPORT bool imwrite(const std::string& path, const Mat& m, const std::vector& params = std::vector()); + +NCNN_EXPORT void imshow(const std::string& name, const Mat& m); + +NCNN_EXPORT int waitKey(int delay = 0); + +#if NCNN_PIXEL +NCNN_EXPORT void resize(const Mat& src, Mat& dst, const Size& size, float sw = 0.f, float sh = 0.f, int flags = 0); +#endif // NCNN_PIXEL + +#if NCNN_PIXEL_DRAWING + +enum +{ + FILLED = -1 +}; + +NCNN_EXPORT void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness = 1); + +NCNN_EXPORT void rectangle(Mat& img, Rect rec, const Scalar& color, int thickness = 1); + +NCNN_EXPORT void circle(Mat& img, Point center, int radius, const Scalar& color, int thickness = 1); + +NCNN_EXPORT void line(Mat& img, Point p0, Point p1, const Scalar& color, int thickness = 1); + +enum +{ + FONT_HERSHEY_SIMPLEX = 0 +}; + +NCNN_EXPORT void putText(Mat& img, const std::string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness = 1); + +NCNN_EXPORT Size getTextSize(const std::string& text, int fontFace, double fontScale, int thickness, int* baseLine); + +#endif // NCNN_PIXEL_DRAWING + +} // namespace cv + +#if defined(_MSC_VER) || defined(__GNUC__) +#pragma pop_macro("min") +#pragma pop_macro("max") +#endif + +#endif // NCNN_SIMPLEOCV + +#endif // NCNN_SIMPLEOCV_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/simpleomp.h b/app/libs/ncnn/arm64-v8a/include/ncnn/simpleomp.h new file mode 100644 index 0000000..0f132f7 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/simpleomp.h @@ -0,0 +1,42 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_SIMPLEOMP_H +#define NCNN_SIMPLEOMP_H + +#include "platform.h" + +#if NCNN_SIMPLEOMP + +#include + +// This minimal openmp runtime implementation only supports the llvm openmp abi +// and only supports #pragma omp parallel for num_threads(X) + +#ifdef __cplusplus +extern "C" { +#endif + +NCNN_EXPORT int omp_get_max_threads(); + +NCNN_EXPORT void omp_set_num_threads(int num_threads); + +NCNN_EXPORT int omp_get_dynamic(); + +NCNN_EXPORT void omp_set_dynamic(int dynamic); + +NCNN_EXPORT int omp_get_num_threads(); + +NCNN_EXPORT int omp_get_thread_num(); + +NCNN_EXPORT int kmp_get_blocktime(); + +NCNN_EXPORT void kmp_set_blocktime(int blocktime); + +#ifdef __cplusplus +} +#endif + +#endif // NCNN_SIMPLEOMP + +#endif // NCNN_SIMPLEOMP_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/simplestl.h b/app/libs/ncnn/arm64-v8a/include/ncnn/simplestl.h new file mode 100644 index 0000000..334d75a --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/simplestl.h @@ -0,0 +1,598 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_SIMPLESTL_H +#define NCNN_SIMPLESTL_H + +#include +#include +#include + +#if !NCNN_SIMPLESTL + +#include + +#else + +// allocation functions +NCNN_EXPORT void* operator new(size_t size); +NCNN_EXPORT void* operator new[](size_t size); +// placement allocation functions +NCNN_EXPORT void* operator new(size_t size, void* ptr); +NCNN_EXPORT void* operator new[](size_t size, void* ptr); +// deallocation functions +NCNN_EXPORT void operator delete(void* ptr); +NCNN_EXPORT void operator delete[](void* ptr); +// deallocation functions since c++14 +#if __cplusplus >= 201402L +NCNN_EXPORT void operator delete(void* ptr, size_t sz); +NCNN_EXPORT void operator delete[](void* ptr, size_t sz); +#endif +// placement deallocation functions +NCNN_EXPORT void operator delete(void* ptr, void* voidptr2); +NCNN_EXPORT void operator delete[](void* ptr, void* voidptr2); + +#endif + +// minimal stl data structure implementation +namespace std { + +template +const T& max(const T& a, const T& b) +{ + return (a < b) ? b : a; +} + +template +const T& min(const T& a, const T& b) +{ + return (a > b) ? b : a; +} + +template +void swap(T& a, T& b) +{ + T temp(a); + a = b; + b = temp; +} + +template +struct pair +{ + pair() + : first(), second() + { + } + pair(const T1& t1, const T2& t2) + : first(t1), second(t2) + { + } + + T1 first; + T2 second; +}; + +template +bool operator==(const pair& x, const pair& y) +{ + return (x.first == y.first && x.second == y.second); +} +template +bool operator<(const pair& x, const pair& y) +{ + return x.first < y.first || (!(y.first < x.first) && x.second < y.second); +} +template +bool operator!=(const pair& x, const pair& y) +{ + return !(x == y); +} +template +bool operator>(const pair& x, const pair& y) +{ + return y < x; +} +template +bool operator<=(const pair& x, const pair& y) +{ + return !(y < x); +} +template +bool operator>=(const pair& x, const pair& y) +{ + return !(x < y); +} + +template +pair make_pair(const T1& t1, const T2& t2) +{ + return pair(t1, t2); +} + +template +struct node +{ + node* prev_; + node* next_; + T data_; + + node() + : prev_(0), next_(0), data_() + { + } + node(const T& t) + : prev_(0), next_(0), data_(t) + { + } +}; + +template +struct iter_list +{ + iter_list() + : curr_(0) + { + } + iter_list(node* n) + : curr_(n) + { + } + iter_list(const iter_list& i) + : curr_(i.curr_) + { + } + ~iter_list() + { + } + + iter_list& operator=(const iter_list& i) + { + curr_ = i.curr_; + return *this; + } + + T& operator*() + { + return curr_->data_; + } + T* operator->() + { + return &(curr_->data_); + } + + bool operator==(const iter_list& i) + { + return curr_ == i.curr_; + } + bool operator!=(const iter_list& i) + { + return curr_ != i.curr_; + } + + iter_list& operator++() + { + curr_ = curr_->next_; + return *this; + } + iter_list& operator--() + { + curr_ = curr_->prev_; + return *this; + } + + node* curr_; +}; + +template +struct list +{ + typedef iter_list iterator; + + list() + { + head_ = new node(); + tail_ = head_; + count_ = 0; + } + ~list() + { + clear(); + delete head_; + } + list(const list& l) + { + head_ = new node(); + tail_ = head_; + count_ = 0; + + for (iter_list i = l.begin(); i != l.end(); ++i) + { + push_back(*i); + } + } + + list& operator=(const list& l) + { + if (this == &l) + { + return *this; + } + clear(); + + for (iter_list i = l.begin(); i != l.end(); ++i) + { + push_back(*i); + } + return *this; + } + + void clear() + { + while (count_ > 0) + { + pop_front(); + } + } + + void pop_front() + { + if (count_ > 0) + { + head_ = head_->next_; + delete head_->prev_; + head_->prev_ = 0; + --count_; + } + } + + size_t size() const + { + return count_; + } + iter_list begin() const + { + return iter_list(head_); + } + iter_list end() const + { + return iter_list(tail_); + } + bool empty() const + { + return count_ == 0; + } + + void push_back(const T& t) + { + if (count_ == 0) + { + head_ = new node(t); + head_->prev_ = 0; + head_->next_ = tail_; + tail_->prev_ = head_; + count_ = 1; + } + else + { + node* temp = new node(t); + temp->prev_ = tail_->prev_; + temp->next_ = tail_; + tail_->prev_->next_ = temp; + tail_->prev_ = temp; + ++count_; + } + } + + iter_list erase(iter_list pos) + { + if (pos != end()) + { + node* temp = pos.curr_; + if (temp == head_) + { + ++pos; + temp->next_->prev_ = 0; + head_ = temp->next_; + } + else + { + --pos; + temp->next_->prev_ = temp->prev_; + temp->prev_->next_ = temp->next_; + ++pos; + } + delete temp; + --count_; + } + return pos; + } + +protected: + node* head_; + node* tail_; + size_t count_; +}; + +template +struct greater +{ + bool operator()(const T& x, const T& y) const + { + return (x > y); + } +}; + +template +struct less +{ + bool operator()(const T& x, const T& y) const + { + return (x < y); + } +}; + +template +void partial_sort(RandomAccessIter first, RandomAccessIter middle, RandomAccessIter last, Compare comp) +{ + // [TODO] heap sort should be used here, but we simply use bubble sort now + for (RandomAccessIter i = first; i < middle; ++i) + { + // bubble sort + for (RandomAccessIter j = last - 1; j > first; --j) + { + if (comp(*j, *(j - 1))) + { + swap(*j, *(j - 1)); + } + } + } +} + +template +struct vector +{ + vector() + : data_(0), size_(0), capacity_(0) + { + } + vector(const size_t new_size, const T& value = T()) + : data_(0), size_(0), capacity_(0) + { + resize(new_size, value); + } + ~vector() + { + clear(); + } + vector(const vector& v) + : data_(0), size_(0), capacity_(0) + { + resize(v.size()); + for (size_t i = 0; i < size_; i++) + { + data_[i] = v.data_[i]; + } + } + + vector& operator=(const vector& v) + { + if (this == &v) + { + return *this; + } + resize(0); + resize(v.size()); + for (size_t i = 0; i < size_; i++) + { + data_[i] = v.data_[i]; + } + return *this; + } + + void resize(const size_t new_size, const T& value = T()) + { + try_alloc(new_size); + if (new_size > size_) + { + for (size_t i = size_; i < new_size; i++) + { + new (&data_[i]) T(value); + } + } + else if (new_size < size_) + { + for (size_t i = new_size; i < size_; i++) + { + data_[i].~T(); + } + } + size_ = new_size; + } + + void clear() + { + for (size_t i = 0; i < size_; i++) + { + data_[i].~T(); + } + delete[](char*) data_; + data_ = 0; + size_ = 0; + capacity_ = 0; + } + + T* data() const + { + return data_; + } + size_t size() const + { + return size_; + } + T& operator[](size_t i) const + { + return data_[i]; + } + T* begin() const + { + return &data_[0]; + } + T* end() const + { + return &data_[size_]; + } + bool empty() const + { + return size_ == 0; + } + + void push_back(const T& t) + { + try_alloc(size_ + 1); + new (&data_[size_]) T(t); + size_++; + } + + void insert(T* pos, T* b, T* e) + { + vector* v = 0; + if (b >= begin() && b < end()) + { + //the same vector + v = new vector(*this); + b = v->begin() + (b - begin()); + e = v->begin() + (e - begin()); + } + size_t diff = pos - begin(); + try_alloc(size_ + (e - b)); + pos = begin() + diff; + memmove(pos + (e - b), pos, (end() - pos) * sizeof(T)); + size_t len = e - b; + size_ += len; + for (size_t i = 0; i < len; i++) + { + *pos = *b; + pos++; + b++; + } + delete v; + } + + T* erase(T* pos) + { + pos->~T(); + memmove(pos, pos + 1, (end() - pos - 1) * sizeof(T)); + size_--; + return pos; + } + + void pop_back() + { + if (size_ > 0) + { + data_[size_ - 1].~T(); + size_--; + } + } + + T& back() const + { + return data_[size_ - 1]; + } + +protected: + T* data_; + size_t size_; + size_t capacity_; + void try_alloc(size_t new_size) + { + if (new_size * 3 / 2 > capacity_ / 2) + { + capacity_ = new_size * 2; + T* new_data = (T*)new char[capacity_ * sizeof(T)]; + memset(static_cast(new_data), 0, capacity_ * sizeof(T)); + if (data_) + { + memmove(new_data, data_, sizeof(T) * size_); + delete[](char*) data_; + } + data_ = new_data; + } + } +}; + +template +struct stack : protected vector +{ + void push(const T& t) + { + vector::push_back(t); + } + + void pop() + { + vector::pop_back(); + } + + T& top() + { + return vector::back(); + } + + bool empty() const + { + return vector::empty(); + } + + size_t size() const + { + return vector::size(); + } + + void clear() + { + vector::clear(); + } +}; + +struct NCNN_EXPORT string : public vector +{ + string() + { + } + string(const char* str) + { + size_t len = strlen(str); + resize(len); + memcpy(data_, str, len); + } + const char* c_str() const + { + return (const char*)data_; + } + bool operator==(const string& str2) const + { + return size_ == str2.size_ && strncmp(data_, str2.data_, size_) == 0; + } + bool operator!=(const string& str2) const + { + return size_ != str2.size_ || strncmp(data_, str2.data_, size_) != 0; + } + string& operator+=(const string& str1) + { + insert(end(), str1.begin(), str1.end()); + return *this; + } +}; + +inline string operator+(const string& str1, const string& str2) +{ + string str(str1); + str.insert(str.end(), str2.begin(), str2.end()); + return str; +} + +} // namespace std + +#endif // NCNN_SIMPLESTL_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/simplevk.h b/app/libs/ncnn/arm64-v8a/include/ncnn/simplevk.h new file mode 100644 index 0000000..c2c7060 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/simplevk.h @@ -0,0 +1,2196 @@ +// Copyright 2023 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_SIMPLEVK_H +#define NCNN_SIMPLEVK_H + +#include "platform.h" + +#if NCNN_VULKAN +#if NCNN_SIMPLEVK + +#define VK_VERSION_1_0 1 + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/* +*************************************************************************************************** +* Platform-specific directives and type declarations +*************************************************************************************************** +*/ + +/* Platform-specific calling convention macros. + * + * Platforms should define these so that Vulkan clients call Vulkan commands + * with the same calling conventions that the Vulkan implementation expects. + * + * VKAPI_ATTR - Placed before the return type in function declarations. + * Useful for C++11 and GCC/Clang-style function attribute syntax. + * VKAPI_CALL - Placed after the return type in function declarations. + * Useful for MSVC-style calling convention syntax. + * VKAPI_PTR - Placed between the '(' and '*' in function pointer types. + * + * Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void); + * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void); + */ +#if defined(_WIN32) +// On Windows, Vulkan commands use the stdcall convention +#define VKAPI_ATTR +#define VKAPI_CALL __stdcall +#define VKAPI_PTR VKAPI_CALL +#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7 +#error "Vulkan isn't supported for the 'armeabi' NDK ABI" +#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE) +// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" +// calling convention, i.e. float parameters are passed in registers. This +// is true even if the rest of the application passes floats on the stack, +// as it does by default when compiling for the armeabi-v7a NDK ABI. +#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp"))) +#define VKAPI_CALL +#define VKAPI_PTR VKAPI_ATTR +#else +// On other platforms, use the default calling convention +#define VKAPI_ATTR +#define VKAPI_CALL +#define VKAPI_PTR +#endif + +#include + +#if !defined(VK_NO_STDINT_H) +#if defined(_MSC_VER) && (_MSC_VER < 1600) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include +#endif +#endif // !defined(VK_NO_STDINT_H) + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +#define VK_MAKE_VERSION(major, minor, patch) (((major) << 22) | ((minor) << 12) | (patch)) + +// Vulkan 1.0 version number +#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 + +#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) +#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) +#define VK_VERSION_PATCH(version) ((uint32_t)(version)&0xfff) +// Version of this file +#define VK_HEADER_VERSION 0 + +#define VK_NULL_HANDLE 0 + +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; + +#if !defined(VK_DEFINE_NON_DISPATCHABLE_HANDLE) +#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T* object; +#else +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; +#endif +#endif + +typedef uint32_t VkBool32; +typedef uint64_t VkDeviceSize; +typedef uint32_t VkFlags; +typedef uint32_t VkSampleMask; + +VK_DEFINE_HANDLE(VkCommandBuffer) +VK_DEFINE_HANDLE(VkDevice) +VK_DEFINE_HANDLE(VkInstance) +VK_DEFINE_HANDLE(VkPhysicalDevice) +VK_DEFINE_HANDLE(VkQueue) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) +#define VK_UUID_SIZE 16U +#define VK_ATTACHMENT_UNUSED (~0U) +#define VK_FALSE 0U +#define VK_LOD_CLAMP_NONE 1000.0F +#define VK_QUEUE_FAMILY_IGNORED (~0U) +#define VK_REMAINING_ARRAY_LAYERS (~0U) +#define VK_REMAINING_MIP_LEVELS (~0U) +#define VK_SUBPASS_EXTERNAL (~0U) +#define VK_TRUE 1U +#define VK_WHOLE_SIZE (~0ULL) +#define VK_MAX_MEMORY_TYPES 32U +#define VK_MAX_MEMORY_HEAPS 16U +#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256U +#define VK_MAX_EXTENSION_NAME_SIZE 256U +#define VK_MAX_DESCRIPTION_SIZE 256U + +typedef enum VkPipelineCacheHeaderVersion +{ + VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, + VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF +} VkPipelineCacheHeaderVersion; + +typedef enum VkResult +{ + VK_SUCCESS = 0, + VK_NOT_READY = 1, + VK_TIMEOUT = 2, + VK_EVENT_SET = 3, + VK_EVENT_RESET = 4, + VK_INCOMPLETE = 5, + VK_ERROR_OUT_OF_HOST_MEMORY = -1, + VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, + VK_ERROR_INITIALIZATION_FAILED = -3, + VK_ERROR_DEVICE_LOST = -4, + VK_ERROR_MEMORY_MAP_FAILED = -5, + VK_ERROR_LAYER_NOT_PRESENT = -6, + VK_ERROR_EXTENSION_NOT_PRESENT = -7, + VK_ERROR_FEATURE_NOT_PRESENT = -8, + VK_ERROR_INCOMPATIBLE_DRIVER = -9, + VK_ERROR_TOO_MANY_OBJECTS = -10, + VK_ERROR_FORMAT_NOT_SUPPORTED = -11, + VK_ERROR_FRAGMENTED_POOL = -12, + VK_ERROR_SURFACE_LOST_KHR = -1000000000, + VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, + VK_SUBOPTIMAL_KHR = 1000001003, + VK_ERROR_OUT_OF_DATE_KHR = -1000001004, + VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, + VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, + VK_ERROR_INVALID_SHADER_NV = -1000012000, + VK_ERROR_OUT_OF_POOL_MEMORY_KHR = -1000069000, + VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = -1000072003, + VK_RESULT_MAX_ENUM = 0x7FFFFFFF +} VkResult; + +typedef enum VkStructureType +{ + VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, + VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, + VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, + VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, + VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, + VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, + VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, + VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, + VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, + VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, + VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, + VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, + VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, + VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, + VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, + VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, + VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, + VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, + VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, + VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, + VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, + VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, + VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, + VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, + VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, + VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, + VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, + VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, + VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, + VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, + VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, + VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, + VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, + VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, + VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, + VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, + VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000, + VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001, + VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR = 1000003000, + VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, + VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, + VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, + VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, + VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, + VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, + VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, + VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, + VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, + VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, + VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkStructureType; + +typedef enum VkSystemAllocationScope +{ + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, + VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, + VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4, + VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7FFFFFFF +} VkSystemAllocationScope; + +typedef enum VkInternalAllocationType +{ + VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0, + VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkInternalAllocationType; + +typedef enum VkFormat +{ + VK_FORMAT_UNDEFINED = 0, + VK_FORMAT_R4G4_UNORM_PACK8 = 1, + VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, + VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, + VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, + VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, + VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, + VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, + VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, + VK_FORMAT_R8_UNORM = 9, + VK_FORMAT_R8_SNORM = 10, + VK_FORMAT_R8_USCALED = 11, + VK_FORMAT_R8_SSCALED = 12, + VK_FORMAT_R8_UINT = 13, + VK_FORMAT_R8_SINT = 14, + VK_FORMAT_R8_SRGB = 15, + VK_FORMAT_R8G8_UNORM = 16, + VK_FORMAT_R8G8_SNORM = 17, + VK_FORMAT_R8G8_USCALED = 18, + VK_FORMAT_R8G8_SSCALED = 19, + VK_FORMAT_R8G8_UINT = 20, + VK_FORMAT_R8G8_SINT = 21, + VK_FORMAT_R8G8_SRGB = 22, + VK_FORMAT_R8G8B8_UNORM = 23, + VK_FORMAT_R8G8B8_SNORM = 24, + VK_FORMAT_R8G8B8_USCALED = 25, + VK_FORMAT_R8G8B8_SSCALED = 26, + VK_FORMAT_R8G8B8_UINT = 27, + VK_FORMAT_R8G8B8_SINT = 28, + VK_FORMAT_R8G8B8_SRGB = 29, + VK_FORMAT_B8G8R8_UNORM = 30, + VK_FORMAT_B8G8R8_SNORM = 31, + VK_FORMAT_B8G8R8_USCALED = 32, + VK_FORMAT_B8G8R8_SSCALED = 33, + VK_FORMAT_B8G8R8_UINT = 34, + VK_FORMAT_B8G8R8_SINT = 35, + VK_FORMAT_B8G8R8_SRGB = 36, + VK_FORMAT_R8G8B8A8_UNORM = 37, + VK_FORMAT_R8G8B8A8_SNORM = 38, + VK_FORMAT_R8G8B8A8_USCALED = 39, + VK_FORMAT_R8G8B8A8_SSCALED = 40, + VK_FORMAT_R8G8B8A8_UINT = 41, + VK_FORMAT_R8G8B8A8_SINT = 42, + VK_FORMAT_R8G8B8A8_SRGB = 43, + VK_FORMAT_B8G8R8A8_UNORM = 44, + VK_FORMAT_B8G8R8A8_SNORM = 45, + VK_FORMAT_B8G8R8A8_USCALED = 46, + VK_FORMAT_B8G8R8A8_SSCALED = 47, + VK_FORMAT_B8G8R8A8_UINT = 48, + VK_FORMAT_B8G8R8A8_SINT = 49, + VK_FORMAT_B8G8R8A8_SRGB = 50, + VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, + VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, + VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, + VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, + VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, + VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, + VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, + VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, + VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, + VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, + VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, + VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, + VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, + VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, + VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, + VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, + VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, + VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, + VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, + VK_FORMAT_R16_UNORM = 70, + VK_FORMAT_R16_SNORM = 71, + VK_FORMAT_R16_USCALED = 72, + VK_FORMAT_R16_SSCALED = 73, + VK_FORMAT_R16_UINT = 74, + VK_FORMAT_R16_SINT = 75, + VK_FORMAT_R16_SFLOAT = 76, + VK_FORMAT_R16G16_UNORM = 77, + VK_FORMAT_R16G16_SNORM = 78, + VK_FORMAT_R16G16_USCALED = 79, + VK_FORMAT_R16G16_SSCALED = 80, + VK_FORMAT_R16G16_UINT = 81, + VK_FORMAT_R16G16_SINT = 82, + VK_FORMAT_R16G16_SFLOAT = 83, + VK_FORMAT_R16G16B16_UNORM = 84, + VK_FORMAT_R16G16B16_SNORM = 85, + VK_FORMAT_R16G16B16_USCALED = 86, + VK_FORMAT_R16G16B16_SSCALED = 87, + VK_FORMAT_R16G16B16_UINT = 88, + VK_FORMAT_R16G16B16_SINT = 89, + VK_FORMAT_R16G16B16_SFLOAT = 90, + VK_FORMAT_R16G16B16A16_UNORM = 91, + VK_FORMAT_R16G16B16A16_SNORM = 92, + VK_FORMAT_R16G16B16A16_USCALED = 93, + VK_FORMAT_R16G16B16A16_SSCALED = 94, + VK_FORMAT_R16G16B16A16_UINT = 95, + VK_FORMAT_R16G16B16A16_SINT = 96, + VK_FORMAT_R16G16B16A16_SFLOAT = 97, + VK_FORMAT_R32_UINT = 98, + VK_FORMAT_R32_SINT = 99, + VK_FORMAT_R32_SFLOAT = 100, + VK_FORMAT_R32G32_UINT = 101, + VK_FORMAT_R32G32_SINT = 102, + VK_FORMAT_R32G32_SFLOAT = 103, + VK_FORMAT_R32G32B32_UINT = 104, + VK_FORMAT_R32G32B32_SINT = 105, + VK_FORMAT_R32G32B32_SFLOAT = 106, + VK_FORMAT_R32G32B32A32_UINT = 107, + VK_FORMAT_R32G32B32A32_SINT = 108, + VK_FORMAT_R32G32B32A32_SFLOAT = 109, + VK_FORMAT_R64_UINT = 110, + VK_FORMAT_R64_SINT = 111, + VK_FORMAT_R64_SFLOAT = 112, + VK_FORMAT_R64G64_UINT = 113, + VK_FORMAT_R64G64_SINT = 114, + VK_FORMAT_R64G64_SFLOAT = 115, + VK_FORMAT_R64G64B64_UINT = 116, + VK_FORMAT_R64G64B64_SINT = 117, + VK_FORMAT_R64G64B64_SFLOAT = 118, + VK_FORMAT_R64G64B64A64_UINT = 119, + VK_FORMAT_R64G64B64A64_SINT = 120, + VK_FORMAT_R64G64B64A64_SFLOAT = 121, + VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, + VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, + VK_FORMAT_D16_UNORM = 124, + VK_FORMAT_X8_D24_UNORM_PACK32 = 125, + VK_FORMAT_D32_SFLOAT = 126, + VK_FORMAT_S8_UINT = 127, + VK_FORMAT_D16_UNORM_S8_UINT = 128, + VK_FORMAT_D24_UNORM_S8_UINT = 129, + VK_FORMAT_D32_SFLOAT_S8_UINT = 130, + VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, + VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, + VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, + VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, + VK_FORMAT_BC2_UNORM_BLOCK = 135, + VK_FORMAT_BC2_SRGB_BLOCK = 136, + VK_FORMAT_BC3_UNORM_BLOCK = 137, + VK_FORMAT_BC3_SRGB_BLOCK = 138, + VK_FORMAT_BC4_UNORM_BLOCK = 139, + VK_FORMAT_BC4_SNORM_BLOCK = 140, + VK_FORMAT_BC5_UNORM_BLOCK = 141, + VK_FORMAT_BC5_SNORM_BLOCK = 142, + VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, + VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, + VK_FORMAT_BC7_UNORM_BLOCK = 145, + VK_FORMAT_BC7_SRGB_BLOCK = 146, + VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, + VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, + VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, + VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, + VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, + VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, + VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, + VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, + VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, + VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, + VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, + VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, + VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, + VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, + VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, + VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, + VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, + VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, + VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, + VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, + VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, + VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, + VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, + VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, + VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, + VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, + VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, + VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, + VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, + VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, + VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, + VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, + VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, + VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, + VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, + VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, + VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, + VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, + VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, + VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, + VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, + VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, + VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, + VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, + VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, + VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, + VK_FORMAT_G8B8G8R8_422_UNORM_KHR = 1000156000, + VK_FORMAT_B8G8R8G8_422_UNORM_KHR = 1000156001, + VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR = 1000156002, + VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR = 1000156003, + VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR = 1000156004, + VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR = 1000156005, + VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR = 1000156006, + VK_FORMAT_R10X6_UNORM_PACK16_KHR = 1000156007, + VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR = 1000156008, + VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR = 1000156009, + VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR = 1000156010, + VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR = 1000156011, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR = 1000156012, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR = 1000156013, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR = 1000156014, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR = 1000156015, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR = 1000156016, + VK_FORMAT_R12X4_UNORM_PACK16_KHR = 1000156017, + VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR = 1000156018, + VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR = 1000156019, + VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR = 1000156020, + VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR = 1000156021, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR = 1000156022, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR = 1000156023, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR = 1000156024, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR = 1000156025, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR = 1000156026, + VK_FORMAT_G16B16G16R16_422_UNORM_KHR = 1000156027, + VK_FORMAT_B16G16R16G16_422_UNORM_KHR = 1000156028, + VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR = 1000156029, + VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR = 1000156030, + VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR = 1000156031, + VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR = 1000156032, + VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR = 1000156033, + VK_FORMAT_MAX_ENUM = 0x7FFFFFFF +} VkFormat; + +typedef enum VkImageType +{ + VK_IMAGE_TYPE_1D = 0, + VK_IMAGE_TYPE_2D = 1, + VK_IMAGE_TYPE_3D = 2, + VK_IMAGE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkImageType; + +typedef enum VkImageTiling +{ + VK_IMAGE_TILING_OPTIMAL = 0, + VK_IMAGE_TILING_LINEAR = 1, + VK_IMAGE_TILING_MAX_ENUM = 0x7FFFFFFF +} VkImageTiling; + +typedef enum VkPhysicalDeviceType +{ + VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, + VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, + VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, + VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, + VK_PHYSICAL_DEVICE_TYPE_CPU = 4, + VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkPhysicalDeviceType; + +typedef enum VkQueryType +{ + VK_QUERY_TYPE_OCCLUSION = 0, + VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, + VK_QUERY_TYPE_TIMESTAMP = 2, + VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkQueryType; + +typedef enum VkSharingMode +{ + VK_SHARING_MODE_EXCLUSIVE = 0, + VK_SHARING_MODE_CONCURRENT = 1, + VK_SHARING_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSharingMode; + +typedef enum VkImageLayout +{ + VK_IMAGE_LAYOUT_UNDEFINED = 0, + VK_IMAGE_LAYOUT_GENERAL = 1, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, + VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, + VK_IMAGE_LAYOUT_PREINITIALIZED = 8, + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, + VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, + VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = 1000117000, + VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = 1000117001, + VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF +} VkImageLayout; + +typedef enum VkImageViewType +{ + VK_IMAGE_VIEW_TYPE_1D = 0, + VK_IMAGE_VIEW_TYPE_2D = 1, + VK_IMAGE_VIEW_TYPE_3D = 2, + VK_IMAGE_VIEW_TYPE_CUBE = 3, + VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, + VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, + VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6, + VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkImageViewType; + +typedef enum VkComponentSwizzle +{ + VK_COMPONENT_SWIZZLE_IDENTITY = 0, + VK_COMPONENT_SWIZZLE_ZERO = 1, + VK_COMPONENT_SWIZZLE_ONE = 2, + VK_COMPONENT_SWIZZLE_R = 3, + VK_COMPONENT_SWIZZLE_G = 4, + VK_COMPONENT_SWIZZLE_B = 5, + VK_COMPONENT_SWIZZLE_A = 6, + VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7FFFFFFF +} VkComponentSwizzle; + +typedef enum VkPrimitiveTopology +{ + VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, + VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10, + VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7FFFFFFF +} VkPrimitiveTopology; + +typedef enum VkPolygonMode +{ + VK_POLYGON_MODE_FILL = 0, + VK_POLYGON_MODE_LINE = 1, + VK_POLYGON_MODE_POINT = 2, + VK_POLYGON_MODE_FILL_RECTANGLE_NV = 1000153000, + VK_POLYGON_MODE_MAX_ENUM = 0x7FFFFFFF +} VkPolygonMode; + +typedef enum VkCompareOp +{ + VK_COMPARE_OP_NEVER = 0, + VK_COMPARE_OP_LESS = 1, + VK_COMPARE_OP_EQUAL = 2, + VK_COMPARE_OP_LESS_OR_EQUAL = 3, + VK_COMPARE_OP_GREATER = 4, + VK_COMPARE_OP_NOT_EQUAL = 5, + VK_COMPARE_OP_GREATER_OR_EQUAL = 6, + VK_COMPARE_OP_ALWAYS = 7, + VK_COMPARE_OP_MAX_ENUM = 0x7FFFFFFF +} VkCompareOp; + +typedef enum VkLogicOp +{ + VK_LOGIC_OP_CLEAR = 0, + VK_LOGIC_OP_AND = 1, + VK_LOGIC_OP_AND_REVERSE = 2, + VK_LOGIC_OP_COPY = 3, + VK_LOGIC_OP_AND_INVERTED = 4, + VK_LOGIC_OP_NO_OP = 5, + VK_LOGIC_OP_XOR = 6, + VK_LOGIC_OP_OR = 7, + VK_LOGIC_OP_NOR = 8, + VK_LOGIC_OP_EQUIVALENT = 9, + VK_LOGIC_OP_INVERT = 10, + VK_LOGIC_OP_OR_REVERSE = 11, + VK_LOGIC_OP_COPY_INVERTED = 12, + VK_LOGIC_OP_OR_INVERTED = 13, + VK_LOGIC_OP_NAND = 14, + VK_LOGIC_OP_SET = 15, + VK_LOGIC_OP_MAX_ENUM = 0x7FFFFFFF +} VkLogicOp; + +typedef enum VkFilter +{ + VK_FILTER_NEAREST = 0, + VK_FILTER_LINEAR = 1, + VK_FILTER_CUBIC_IMG = 1000015000, + VK_FILTER_MAX_ENUM = 0x7FFFFFFF +} VkFilter; + +typedef enum VkSamplerMipmapMode +{ + VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, + VK_SAMPLER_MIPMAP_MODE_LINEAR = 1, + VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerMipmapMode; + +typedef enum VkSamplerAddressMode +{ + VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, + VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3, + VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 4, + VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerAddressMode; + +typedef enum VkBorderColor +{ + VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, + VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, + VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, + VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, + VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, + VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5, + VK_BORDER_COLOR_MAX_ENUM = 0x7FFFFFFF +} VkBorderColor; + +typedef enum VkDescriptorType +{ + VK_DESCRIPTOR_TYPE_SAMPLER = 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, + VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, + VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, + VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, + VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, + VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10, + VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorType; + +typedef enum VkPipelineBindPoint +{ + VK_PIPELINE_BIND_POINT_GRAPHICS = 0, + VK_PIPELINE_BIND_POINT_COMPUTE = 1, + VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7FFFFFFF +} VkPipelineBindPoint; + +typedef enum VkCommandBufferLevel +{ + VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, + VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1, + VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferLevel; + +typedef enum VkIndexType +{ + VK_INDEX_TYPE_UINT16 = 0, + VK_INDEX_TYPE_UINT32 = 1, + VK_INDEX_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkIndexType; + +typedef enum VkObjectType +{ + VK_OBJECT_TYPE_UNKNOWN = 0, + VK_OBJECT_TYPE_INSTANCE = 1, + VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, + VK_OBJECT_TYPE_DEVICE = 3, + VK_OBJECT_TYPE_QUEUE = 4, + VK_OBJECT_TYPE_SEMAPHORE = 5, + VK_OBJECT_TYPE_COMMAND_BUFFER = 6, + VK_OBJECT_TYPE_FENCE = 7, + VK_OBJECT_TYPE_DEVICE_MEMORY = 8, + VK_OBJECT_TYPE_BUFFER = 9, + VK_OBJECT_TYPE_IMAGE = 10, + VK_OBJECT_TYPE_EVENT = 11, + VK_OBJECT_TYPE_QUERY_POOL = 12, + VK_OBJECT_TYPE_BUFFER_VIEW = 13, + VK_OBJECT_TYPE_IMAGE_VIEW = 14, + VK_OBJECT_TYPE_SHADER_MODULE = 15, + VK_OBJECT_TYPE_PIPELINE_CACHE = 16, + VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, + VK_OBJECT_TYPE_RENDER_PASS = 18, + VK_OBJECT_TYPE_PIPELINE = 19, + VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, + VK_OBJECT_TYPE_SAMPLER = 21, + VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, + VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, + VK_OBJECT_TYPE_FRAMEBUFFER = 24, + VK_OBJECT_TYPE_COMMAND_POOL = 25, + VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, + VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, + VK_OBJECT_TYPE_DISPLAY_KHR = 1000002000, + VK_OBJECT_TYPE_DISPLAY_MODE_KHR = 1000002001, + VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000, + VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = 1000085000, + VK_OBJECT_TYPE_OBJECT_TABLE_NVX = 1000086000, + VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX = 1000086001, + VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = 1000156000, + VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000, + VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkObjectType; + +typedef VkFlags VkInstanceCreateFlags; + +typedef enum VkFormatFeatureFlagBits +{ + VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, + VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, + VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, + VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, + VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, + VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, + VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, + VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, + VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000, + VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = 0x00010000, + VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = 0x00020000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = 0x00040000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = 0x00080000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = 0x00100000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = 0x00200000, + VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = 0x00400000, + VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = 0x00800000, + VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkFormatFeatureFlagBits; +typedef VkFlags VkFormatFeatureFlags; + +typedef enum VkImageUsageFlagBits +{ + VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, + VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, + VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, + VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, + VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, + VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, + VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageUsageFlagBits; +typedef VkFlags VkImageUsageFlags; + +typedef enum VkImageCreateFlagBits +{ + VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, + VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, + VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, + VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, + VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, + VK_IMAGE_CREATE_BIND_SFR_BIT_KHX = 0x00000040, + VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020, + VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = 0x00000080, + VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR = 0x00000100, + VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, + VK_IMAGE_CREATE_DISJOINT_BIT_KHR = 0x00000200, + VK_IMAGE_CREATE_ALIAS_BIT_KHR = 0x00000400, + VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageCreateFlagBits; +typedef VkFlags VkImageCreateFlags; + +typedef enum VkSampleCountFlagBits +{ + VK_SAMPLE_COUNT_1_BIT = 0x00000001, + VK_SAMPLE_COUNT_2_BIT = 0x00000002, + VK_SAMPLE_COUNT_4_BIT = 0x00000004, + VK_SAMPLE_COUNT_8_BIT = 0x00000008, + VK_SAMPLE_COUNT_16_BIT = 0x00000010, + VK_SAMPLE_COUNT_32_BIT = 0x00000020, + VK_SAMPLE_COUNT_64_BIT = 0x00000040, + VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSampleCountFlagBits; +typedef VkFlags VkSampleCountFlags; + +typedef enum VkQueueFlagBits +{ + VK_QUEUE_GRAPHICS_BIT = 0x00000001, + VK_QUEUE_COMPUTE_BIT = 0x00000002, + VK_QUEUE_TRANSFER_BIT = 0x00000004, + VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, + VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueueFlagBits; +typedef VkFlags VkQueueFlags; + +typedef enum VkMemoryPropertyFlagBits +{ + VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, + VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, + VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, + VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryPropertyFlagBits; +typedef VkFlags VkMemoryPropertyFlags; + +typedef enum VkMemoryHeapFlagBits +{ + VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHX = 0x00000002, + VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryHeapFlagBits; +typedef VkFlags VkMemoryHeapFlags; +typedef VkFlags VkDeviceCreateFlags; +typedef VkFlags VkDeviceQueueCreateFlags; + +typedef enum VkPipelineStageFlagBits +{ + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, + VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, + VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, + VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, + VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, + VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, + VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, + VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, + VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, + VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, + VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, + VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000, + VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPipelineStageFlagBits; +typedef VkFlags VkPipelineStageFlags; +typedef VkFlags VkMemoryMapFlags; + +typedef enum VkImageAspectFlagBits +{ + VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, + VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, + VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, + VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, + VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = 0x00000010, + VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = 0x00000020, + VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = 0x00000040, + VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageAspectFlagBits; +typedef VkFlags VkImageAspectFlags; + +typedef enum VkFenceCreateFlagBits +{ + VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, + VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkFenceCreateFlagBits; +typedef VkFlags VkFenceCreateFlags; +typedef VkFlags VkSemaphoreCreateFlags; +typedef VkFlags VkEventCreateFlags; +typedef VkFlags VkQueryPoolCreateFlags; + +typedef enum VkQueryPipelineStatisticFlagBits +{ + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, + VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, + VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, + VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, + VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryPipelineStatisticFlagBits; +typedef VkFlags VkQueryPipelineStatisticFlags; + +typedef enum VkQueryResultFlagBits +{ + VK_QUERY_RESULT_64_BIT = 0x00000001, + VK_QUERY_RESULT_WAIT_BIT = 0x00000002, + VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, + VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, + VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryResultFlagBits; +typedef VkFlags VkQueryResultFlags; + +typedef enum VkBufferCreateFlagBits +{ + VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, + VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, + VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, + VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkBufferCreateFlagBits; +typedef VkFlags VkBufferCreateFlags; + +typedef enum VkBufferUsageFlagBits +{ + VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, + VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, + VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, + VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, + VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, + VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, + VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkBufferUsageFlagBits; +typedef VkFlags VkBufferUsageFlags; +typedef VkFlags VkBufferViewCreateFlags; +typedef VkFlags VkImageViewCreateFlags; +typedef VkFlags VkShaderModuleCreateFlags; +typedef VkFlags VkPipelineCacheCreateFlags; + +typedef enum VkPipelineCreateFlagBits +{ + VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, + VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, + VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, + VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHX = 0x00000008, + VK_PIPELINE_CREATE_DISPATCH_BASE_KHX = 0x00000010, + VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPipelineCreateFlagBits; +typedef VkFlags VkPipelineCreateFlags; +typedef VkFlags VkPipelineShaderStageCreateFlags; + +typedef enum VkShaderStageFlagBits +{ + VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, + VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, + VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, + VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, + VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, + VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, + VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, + VK_SHADER_STAGE_ALL = 0x7FFFFFFF, + VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkShaderStageFlagBits; +typedef VkFlags VkPipelineVertexInputStateCreateFlags; +typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; +typedef VkFlags VkPipelineTessellationStateCreateFlags; +typedef VkFlags VkPipelineViewportStateCreateFlags; +typedef VkFlags VkPipelineRasterizationStateCreateFlags; + +typedef VkFlags VkPipelineMultisampleStateCreateFlags; +typedef VkFlags VkPipelineDepthStencilStateCreateFlags; +typedef VkFlags VkPipelineColorBlendStateCreateFlags; + +typedef VkFlags VkPipelineDynamicStateCreateFlags; +typedef VkFlags VkPipelineLayoutCreateFlags; +typedef VkFlags VkShaderStageFlags; +typedef VkFlags VkSamplerCreateFlags; + +typedef enum VkDescriptorSetLayoutCreateFlagBits +{ + VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorSetLayoutCreateFlagBits; +typedef VkFlags VkDescriptorSetLayoutCreateFlags; + +typedef enum VkDescriptorPoolCreateFlagBits +{ + VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, + VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorPoolCreateFlagBits; +typedef VkFlags VkDescriptorPoolCreateFlags; +typedef VkFlags VkDescriptorPoolResetFlags; +typedef VkFlags VkFramebufferCreateFlags; +typedef VkFlags VkRenderPassCreateFlags; + +typedef enum VkAccessFlagBits +{ + VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, + VK_ACCESS_INDEX_READ_BIT = 0x00000002, + VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, + VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, + VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, + VK_ACCESS_SHADER_READ_BIT = 0x00000020, + VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, + VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, + VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, + VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, + VK_ACCESS_HOST_READ_BIT = 0x00002000, + VK_ACCESS_HOST_WRITE_BIT = 0x00004000, + VK_ACCESS_MEMORY_READ_BIT = 0x00008000, + VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, + VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000, + VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000, + VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000, + VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkAccessFlagBits; +typedef VkFlags VkAccessFlags; + +typedef enum VkDependencyFlagBits +{ + VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, + VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX = 0x00000002, + VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX = 0x00000004, + VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDependencyFlagBits; +typedef VkFlags VkDependencyFlags; + +typedef enum VkCommandPoolCreateFlagBits +{ + VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, + VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, + VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandPoolCreateFlagBits; +typedef VkFlags VkCommandPoolCreateFlags; + +typedef enum VkCommandPoolResetFlagBits +{ + VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, + VK_COMMAND_POOL_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandPoolResetFlagBits; +typedef VkFlags VkCommandPoolResetFlags; + +typedef enum VkCommandBufferUsageFlagBits +{ + VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, + VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, + VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, + VK_COMMAND_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferUsageFlagBits; +typedef VkFlags VkCommandBufferUsageFlags; + +typedef enum VkQueryControlFlagBits +{ + VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, + VK_QUERY_CONTROL_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryControlFlagBits; +typedef VkFlags VkQueryControlFlags; + +typedef enum VkCommandBufferResetFlagBits +{ + VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, + VK_COMMAND_BUFFER_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferResetFlagBits; +typedef VkFlags VkCommandBufferResetFlags; + +typedef struct VkApplicationInfo +{ + VkStructureType sType; + const void* pNext; + const char* pApplicationName; + uint32_t applicationVersion; + const char* pEngineName; + uint32_t engineVersion; + uint32_t apiVersion; +} VkApplicationInfo; + +typedef struct VkInstanceCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkInstanceCreateFlags flags; + const VkApplicationInfo* pApplicationInfo; + uint32_t enabledLayerCount; + const char* const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char* const* ppEnabledExtensionNames; +} VkInstanceCreateInfo; + +typedef void*(VKAPI_PTR* PFN_vkAllocationFunction)( + void* pUserData, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + +typedef void*(VKAPI_PTR* PFN_vkReallocationFunction)( + void* pUserData, + void* pOriginal, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + +typedef void(VKAPI_PTR* PFN_vkFreeFunction)( + void* pUserData, + void* pMemory); + +typedef void(VKAPI_PTR* PFN_vkInternalAllocationNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + +typedef void(VKAPI_PTR* PFN_vkInternalFreeNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + +typedef struct VkAllocationCallbacks +{ + void* pUserData; + PFN_vkAllocationFunction pfnAllocation; + PFN_vkReallocationFunction pfnReallocation; + PFN_vkFreeFunction pfnFree; + PFN_vkInternalAllocationNotification pfnInternalAllocation; + PFN_vkInternalFreeNotification pfnInternalFree; +} VkAllocationCallbacks; + +typedef struct VkPhysicalDeviceFeatures +{ + VkBool32 robustBufferAccess; + VkBool32 fullDrawIndexUint32; + VkBool32 imageCubeArray; + VkBool32 independentBlend; + VkBool32 geometryShader; + VkBool32 tessellationShader; + VkBool32 sampleRateShading; + VkBool32 dualSrcBlend; + VkBool32 logicOp; + VkBool32 multiDrawIndirect; + VkBool32 drawIndirectFirstInstance; + VkBool32 depthClamp; + VkBool32 depthBiasClamp; + VkBool32 fillModeNonSolid; + VkBool32 depthBounds; + VkBool32 wideLines; + VkBool32 largePoints; + VkBool32 alphaToOne; + VkBool32 multiViewport; + VkBool32 samplerAnisotropy; + VkBool32 textureCompressionETC2; + VkBool32 textureCompressionASTC_LDR; + VkBool32 textureCompressionBC; + VkBool32 occlusionQueryPrecise; + VkBool32 pipelineStatisticsQuery; + VkBool32 vertexPipelineStoresAndAtomics; + VkBool32 fragmentStoresAndAtomics; + VkBool32 shaderTessellationAndGeometryPointSize; + VkBool32 shaderImageGatherExtended; + VkBool32 shaderStorageImageExtendedFormats; + VkBool32 shaderStorageImageMultisample; + VkBool32 shaderStorageImageReadWithoutFormat; + VkBool32 shaderStorageImageWriteWithoutFormat; + VkBool32 shaderUniformBufferArrayDynamicIndexing; + VkBool32 shaderSampledImageArrayDynamicIndexing; + VkBool32 shaderStorageBufferArrayDynamicIndexing; + VkBool32 shaderStorageImageArrayDynamicIndexing; + VkBool32 shaderClipDistance; + VkBool32 shaderCullDistance; + VkBool32 shaderFloat64; + VkBool32 shaderInt64; + VkBool32 shaderInt16; + VkBool32 shaderResourceResidency; + VkBool32 shaderResourceMinLod; + VkBool32 sparseBinding; + VkBool32 sparseResidencyBuffer; + VkBool32 sparseResidencyImage2D; + VkBool32 sparseResidencyImage3D; + VkBool32 sparseResidency2Samples; + VkBool32 sparseResidency4Samples; + VkBool32 sparseResidency8Samples; + VkBool32 sparseResidency16Samples; + VkBool32 sparseResidencyAliased; + VkBool32 variableMultisampleRate; + VkBool32 inheritedQueries; +} VkPhysicalDeviceFeatures; + +typedef struct VkFormatProperties +{ + VkFormatFeatureFlags linearTilingFeatures; + VkFormatFeatureFlags optimalTilingFeatures; + VkFormatFeatureFlags bufferFeatures; +} VkFormatProperties; + +typedef struct VkExtent3D +{ + uint32_t width; + uint32_t height; + uint32_t depth; +} VkExtent3D; + +typedef struct VkImageFormatProperties +{ + VkExtent3D maxExtent; + uint32_t maxMipLevels; + uint32_t maxArrayLayers; + VkSampleCountFlags sampleCounts; + VkDeviceSize maxResourceSize; +} VkImageFormatProperties; + +typedef struct VkPhysicalDeviceLimits +{ + uint32_t maxImageDimension1D; + uint32_t maxImageDimension2D; + uint32_t maxImageDimension3D; + uint32_t maxImageDimensionCube; + uint32_t maxImageArrayLayers; + uint32_t maxTexelBufferElements; + uint32_t maxUniformBufferRange; + uint32_t maxStorageBufferRange; + uint32_t maxPushConstantsSize; + uint32_t maxMemoryAllocationCount; + uint32_t maxSamplerAllocationCount; + VkDeviceSize bufferImageGranularity; + VkDeviceSize sparseAddressSpaceSize; + uint32_t maxBoundDescriptorSets; + uint32_t maxPerStageDescriptorSamplers; + uint32_t maxPerStageDescriptorUniformBuffers; + uint32_t maxPerStageDescriptorStorageBuffers; + uint32_t maxPerStageDescriptorSampledImages; + uint32_t maxPerStageDescriptorStorageImages; + uint32_t maxPerStageDescriptorInputAttachments; + uint32_t maxPerStageResources; + uint32_t maxDescriptorSetSamplers; + uint32_t maxDescriptorSetUniformBuffers; + uint32_t maxDescriptorSetUniformBuffersDynamic; + uint32_t maxDescriptorSetStorageBuffers; + uint32_t maxDescriptorSetStorageBuffersDynamic; + uint32_t maxDescriptorSetSampledImages; + uint32_t maxDescriptorSetStorageImages; + uint32_t maxDescriptorSetInputAttachments; + uint32_t maxVertexInputAttributes; + uint32_t maxVertexInputBindings; + uint32_t maxVertexInputAttributeOffset; + uint32_t maxVertexInputBindingStride; + uint32_t maxVertexOutputComponents; + uint32_t maxTessellationGenerationLevel; + uint32_t maxTessellationPatchSize; + uint32_t maxTessellationControlPerVertexInputComponents; + uint32_t maxTessellationControlPerVertexOutputComponents; + uint32_t maxTessellationControlPerPatchOutputComponents; + uint32_t maxTessellationControlTotalOutputComponents; + uint32_t maxTessellationEvaluationInputComponents; + uint32_t maxTessellationEvaluationOutputComponents; + uint32_t maxGeometryShaderInvocations; + uint32_t maxGeometryInputComponents; + uint32_t maxGeometryOutputComponents; + uint32_t maxGeometryOutputVertices; + uint32_t maxGeometryTotalOutputComponents; + uint32_t maxFragmentInputComponents; + uint32_t maxFragmentOutputAttachments; + uint32_t maxFragmentDualSrcAttachments; + uint32_t maxFragmentCombinedOutputResources; + uint32_t maxComputeSharedMemorySize; + uint32_t maxComputeWorkGroupCount[3]; + uint32_t maxComputeWorkGroupInvocations; + uint32_t maxComputeWorkGroupSize[3]; + uint32_t subPixelPrecisionBits; + uint32_t subTexelPrecisionBits; + uint32_t mipmapPrecisionBits; + uint32_t maxDrawIndexedIndexValue; + uint32_t maxDrawIndirectCount; + float maxSamplerLodBias; + float maxSamplerAnisotropy; + uint32_t maxViewports; + uint32_t maxViewportDimensions[2]; + float viewportBoundsRange[2]; + uint32_t viewportSubPixelBits; + size_t minMemoryMapAlignment; + VkDeviceSize minTexelBufferOffsetAlignment; + VkDeviceSize minUniformBufferOffsetAlignment; + VkDeviceSize minStorageBufferOffsetAlignment; + int32_t minTexelOffset; + uint32_t maxTexelOffset; + int32_t minTexelGatherOffset; + uint32_t maxTexelGatherOffset; + float minInterpolationOffset; + float maxInterpolationOffset; + uint32_t subPixelInterpolationOffsetBits; + uint32_t maxFramebufferWidth; + uint32_t maxFramebufferHeight; + uint32_t maxFramebufferLayers; + VkSampleCountFlags framebufferColorSampleCounts; + VkSampleCountFlags framebufferDepthSampleCounts; + VkSampleCountFlags framebufferStencilSampleCounts; + VkSampleCountFlags framebufferNoAttachmentsSampleCounts; + uint32_t maxColorAttachments; + VkSampleCountFlags sampledImageColorSampleCounts; + VkSampleCountFlags sampledImageIntegerSampleCounts; + VkSampleCountFlags sampledImageDepthSampleCounts; + VkSampleCountFlags sampledImageStencilSampleCounts; + VkSampleCountFlags storageImageSampleCounts; + uint32_t maxSampleMaskWords; + VkBool32 timestampComputeAndGraphics; + float timestampPeriod; + uint32_t maxClipDistances; + uint32_t maxCullDistances; + uint32_t maxCombinedClipAndCullDistances; + uint32_t discreteQueuePriorities; + float pointSizeRange[2]; + float lineWidthRange[2]; + float pointSizeGranularity; + float lineWidthGranularity; + VkBool32 strictLines; + VkBool32 standardSampleLocations; + VkDeviceSize optimalBufferCopyOffsetAlignment; + VkDeviceSize optimalBufferCopyRowPitchAlignment; + VkDeviceSize nonCoherentAtomSize; +} VkPhysicalDeviceLimits; + +typedef struct VkPhysicalDeviceSparseProperties +{ + VkBool32 residencyStandard2DBlockShape; + VkBool32 residencyStandard2DMultisampleBlockShape; + VkBool32 residencyStandard3DBlockShape; + VkBool32 residencyAlignedMipSize; + VkBool32 residencyNonResidentStrict; +} VkPhysicalDeviceSparseProperties; + +typedef struct VkPhysicalDeviceProperties +{ + uint32_t apiVersion; + uint32_t driverVersion; + uint32_t vendorID; + uint32_t deviceID; + VkPhysicalDeviceType deviceType; + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; + uint8_t pipelineCacheUUID[VK_UUID_SIZE]; + VkPhysicalDeviceLimits limits; + VkPhysicalDeviceSparseProperties sparseProperties; +} VkPhysicalDeviceProperties; + +typedef struct VkQueueFamilyProperties +{ + VkQueueFlags queueFlags; + uint32_t queueCount; + uint32_t timestampValidBits; + VkExtent3D minImageTransferGranularity; +} VkQueueFamilyProperties; + +typedef struct VkMemoryType +{ + VkMemoryPropertyFlags propertyFlags; + uint32_t heapIndex; +} VkMemoryType; + +typedef struct VkMemoryHeap +{ + VkDeviceSize size; + VkMemoryHeapFlags flags; +} VkMemoryHeap; + +typedef struct VkPhysicalDeviceMemoryProperties +{ + uint32_t memoryTypeCount; + VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; + uint32_t memoryHeapCount; + VkMemoryHeap memoryHeaps[VK_MAX_MEMORY_HEAPS]; +} VkPhysicalDeviceMemoryProperties; + +typedef void(VKAPI_PTR* PFN_vkVoidFunction)(void); +typedef struct VkDeviceQueueCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkDeviceQueueCreateFlags flags; + uint32_t queueFamilyIndex; + uint32_t queueCount; + const float* pQueuePriorities; +} VkDeviceQueueCreateInfo; + +typedef struct VkDeviceCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkDeviceCreateFlags flags; + uint32_t queueCreateInfoCount; + const VkDeviceQueueCreateInfo* pQueueCreateInfos; + uint32_t enabledLayerCount; + const char* const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char* const* ppEnabledExtensionNames; + const VkPhysicalDeviceFeatures* pEnabledFeatures; +} VkDeviceCreateInfo; + +typedef struct VkExtensionProperties +{ + char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; +} VkExtensionProperties; + +typedef struct VkLayerProperties +{ + char layerName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; + uint32_t implementationVersion; + char description[VK_MAX_DESCRIPTION_SIZE]; +} VkLayerProperties; + +typedef struct VkSubmitInfo +{ + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore* pWaitSemaphores; + const VkPipelineStageFlags* pWaitDstStageMask; + uint32_t commandBufferCount; + const VkCommandBuffer* pCommandBuffers; + uint32_t signalSemaphoreCount; + const VkSemaphore* pSignalSemaphores; +} VkSubmitInfo; + +typedef struct VkMemoryAllocateInfo +{ + VkStructureType sType; + const void* pNext; + VkDeviceSize allocationSize; + uint32_t memoryTypeIndex; +} VkMemoryAllocateInfo; + +typedef struct VkMappedMemoryRange +{ + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; + VkDeviceSize offset; + VkDeviceSize size; +} VkMappedMemoryRange; + +typedef struct VkMemoryRequirements +{ + VkDeviceSize size; + VkDeviceSize alignment; + uint32_t memoryTypeBits; +} VkMemoryRequirements; + +typedef struct VkImageSubresource +{ + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t arrayLayer; +} VkImageSubresource; + +typedef struct VkOffset3D +{ + int32_t x; + int32_t y; + int32_t z; +} VkOffset3D; + +typedef struct VkFenceCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkFenceCreateFlags flags; +} VkFenceCreateInfo; + +typedef struct VkSemaphoreCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkSemaphoreCreateFlags flags; +} VkSemaphoreCreateInfo; + +typedef struct VkQueryPoolCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkQueryPoolCreateFlags flags; + VkQueryType queryType; + uint32_t queryCount; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkQueryPoolCreateInfo; + +typedef struct VkBufferCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkDeviceSize size; + VkBufferUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; +} VkBufferCreateInfo; + +typedef struct VkBufferViewCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkBufferViewCreateFlags flags; + VkBuffer buffer; + VkFormat format; + VkDeviceSize offset; + VkDeviceSize range; +} VkBufferViewCreateInfo; + +typedef struct VkImageCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkImageCreateFlags flags; + VkImageType imageType; + VkFormat format; + VkExtent3D extent; + uint32_t mipLevels; + uint32_t arrayLayers; + VkSampleCountFlagBits samples; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; + VkImageLayout initialLayout; +} VkImageCreateInfo; + +typedef struct VkSubresourceLayout +{ + VkDeviceSize offset; + VkDeviceSize size; + VkDeviceSize rowPitch; + VkDeviceSize arrayPitch; + VkDeviceSize depthPitch; +} VkSubresourceLayout; + +typedef struct VkComponentMapping +{ + VkComponentSwizzle r; + VkComponentSwizzle g; + VkComponentSwizzle b; + VkComponentSwizzle a; +} VkComponentMapping; + +typedef struct VkImageSubresourceRange +{ + VkImageAspectFlags aspectMask; + uint32_t baseMipLevel; + uint32_t levelCount; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceRange; + +typedef struct VkImageViewCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkImageViewCreateFlags flags; + VkImage image; + VkImageViewType viewType; + VkFormat format; + VkComponentMapping components; + VkImageSubresourceRange subresourceRange; +} VkImageViewCreateInfo; + +typedef struct VkShaderModuleCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkShaderModuleCreateFlags flags; + size_t codeSize; + const uint32_t* pCode; +} VkShaderModuleCreateInfo; + +typedef struct VkPipelineCacheCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkPipelineCacheCreateFlags flags; + size_t initialDataSize; + const void* pInitialData; +} VkPipelineCacheCreateInfo; + +typedef struct VkSpecializationMapEntry +{ + uint32_t constantID; + uint32_t offset; + size_t size; +} VkSpecializationMapEntry; + +typedef struct VkSpecializationInfo +{ + uint32_t mapEntryCount; + const VkSpecializationMapEntry* pMapEntries; + size_t dataSize; + const void* pData; +} VkSpecializationInfo; + +typedef struct VkPipelineShaderStageCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkPipelineShaderStageCreateFlags flags; + VkShaderStageFlagBits stage; + VkShaderModule module; + const char* pName; + const VkSpecializationInfo* pSpecializationInfo; +} VkPipelineShaderStageCreateInfo; + +typedef struct VkViewport +{ + float x; + float y; + float width; + float height; + float minDepth; + float maxDepth; +} VkViewport; + +typedef struct VkOffset2D +{ + int32_t x; + int32_t y; +} VkOffset2D; + +typedef struct VkExtent2D +{ + uint32_t width; + uint32_t height; +} VkExtent2D; + +typedef struct VkRect2D +{ + VkOffset2D offset; + VkExtent2D extent; +} VkRect2D; + +typedef struct VkComputePipelineCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkPipelineCreateFlags flags; + VkPipelineShaderStageCreateInfo stage; + VkPipelineLayout layout; + VkPipeline basePipelineHandle; + int32_t basePipelineIndex; +} VkComputePipelineCreateInfo; + +typedef struct VkPushConstantRange +{ + VkShaderStageFlags stageFlags; + uint32_t offset; + uint32_t size; +} VkPushConstantRange; + +typedef struct VkPipelineLayoutCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkPipelineLayoutCreateFlags flags; + uint32_t setLayoutCount; + const VkDescriptorSetLayout* pSetLayouts; + uint32_t pushConstantRangeCount; + const VkPushConstantRange* pPushConstantRanges; +} VkPipelineLayoutCreateInfo; + +typedef struct VkSamplerCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkSamplerCreateFlags flags; + VkFilter magFilter; + VkFilter minFilter; + VkSamplerMipmapMode mipmapMode; + VkSamplerAddressMode addressModeU; + VkSamplerAddressMode addressModeV; + VkSamplerAddressMode addressModeW; + float mipLodBias; + VkBool32 anisotropyEnable; + float maxAnisotropy; + VkBool32 compareEnable; + VkCompareOp compareOp; + float minLod; + float maxLod; + VkBorderColor borderColor; + VkBool32 unnormalizedCoordinates; +} VkSamplerCreateInfo; + +typedef struct VkDescriptorSetLayoutBinding +{ + uint32_t binding; + VkDescriptorType descriptorType; + uint32_t descriptorCount; + VkShaderStageFlags stageFlags; + const VkSampler* pImmutableSamplers; +} VkDescriptorSetLayoutBinding; + +typedef struct VkDescriptorSetLayoutCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkDescriptorSetLayoutCreateFlags flags; + uint32_t bindingCount; + const VkDescriptorSetLayoutBinding* pBindings; +} VkDescriptorSetLayoutCreateInfo; + +typedef struct VkDescriptorPoolSize +{ + VkDescriptorType type; + uint32_t descriptorCount; +} VkDescriptorPoolSize; + +typedef struct VkDescriptorPoolCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkDescriptorPoolCreateFlags flags; + uint32_t maxSets; + uint32_t poolSizeCount; + const VkDescriptorPoolSize* pPoolSizes; +} VkDescriptorPoolCreateInfo; + +typedef struct VkDescriptorSetAllocateInfo +{ + VkStructureType sType; + const void* pNext; + VkDescriptorPool descriptorPool; + uint32_t descriptorSetCount; + const VkDescriptorSetLayout* pSetLayouts; +} VkDescriptorSetAllocateInfo; + +typedef struct VkDescriptorImageInfo +{ + VkSampler sampler; + VkImageView imageView; + VkImageLayout imageLayout; +} VkDescriptorImageInfo; + +typedef struct VkDescriptorBufferInfo +{ + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize range; +} VkDescriptorBufferInfo; + +typedef struct VkWriteDescriptorSet +{ + VkStructureType sType; + const void* pNext; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + const VkDescriptorImageInfo* pImageInfo; + const VkDescriptorBufferInfo* pBufferInfo; + const VkBufferView* pTexelBufferView; +} VkWriteDescriptorSet; + +typedef struct VkCopyDescriptorSet +{ + VkStructureType sType; + const void* pNext; + VkDescriptorSet srcSet; + uint32_t srcBinding; + uint32_t srcArrayElement; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; +} VkCopyDescriptorSet; + +typedef struct VkCommandPoolCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkCommandPoolCreateFlags flags; + uint32_t queueFamilyIndex; +} VkCommandPoolCreateInfo; + +typedef struct VkCommandBufferAllocateInfo +{ + VkStructureType sType; + const void* pNext; + VkCommandPool commandPool; + VkCommandBufferLevel level; + uint32_t commandBufferCount; +} VkCommandBufferAllocateInfo; + +typedef struct VkCommandBufferInheritanceInfo +{ + VkStructureType sType; + const void* pNext; + VkRenderPass renderPass; + uint32_t subpass; + VkFramebuffer framebuffer; + VkBool32 occlusionQueryEnable; + VkQueryControlFlags queryFlags; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkCommandBufferInheritanceInfo; + +typedef struct VkCommandBufferBeginInfo +{ + VkStructureType sType; + const void* pNext; + VkCommandBufferUsageFlags flags; + const VkCommandBufferInheritanceInfo* pInheritanceInfo; +} VkCommandBufferBeginInfo; + +typedef struct VkBufferCopy +{ + VkDeviceSize srcOffset; + VkDeviceSize dstOffset; + VkDeviceSize size; +} VkBufferCopy; + +typedef struct VkImageSubresourceLayers +{ + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceLayers; + +typedef struct VkImageCopy +{ + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageCopy; + +typedef struct VkBufferImageCopy +{ + VkDeviceSize bufferOffset; + uint32_t bufferRowLength; + uint32_t bufferImageHeight; + VkImageSubresourceLayers imageSubresource; + VkOffset3D imageOffset; + VkExtent3D imageExtent; +} VkBufferImageCopy; + +typedef struct VkImageResolve +{ + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageResolve; + +typedef struct VkMemoryBarrier +{ + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; +} VkMemoryBarrier; + +typedef struct VkBufferMemoryBarrier +{ + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize size; +} VkBufferMemoryBarrier; + +typedef struct VkImageMemoryBarrier +{ + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkImageLayout oldLayout; + VkImageLayout newLayout; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkImage image; + VkImageSubresourceRange subresourceRange; +} VkImageMemoryBarrier; + +typedef struct VkDispatchIndirectCommand +{ + uint32_t x; + uint32_t y; + uint32_t z; +} VkDispatchIndirectCommand; + +// vulkan base functions +typedef VkResult(VKAPI_PTR* PFN_vkEnumerateInstanceExtensionProperties)(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance); +typedef PFN_vkVoidFunction(VKAPI_PTR* PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); + +typedef VkResult(VKAPI_PTR* PFN_vkAllocateCommandBuffers)(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers); +typedef VkResult(VKAPI_PTR* PFN_vkAllocateDescriptorSets)(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets); +typedef VkResult(VKAPI_PTR* PFN_vkAllocateMemory)(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory); +typedef VkResult(VKAPI_PTR* PFN_vkBeginCommandBuffer)(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo); +typedef VkResult(VKAPI_PTR* PFN_vkBindBufferMemory)(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); +typedef VkResult(VKAPI_PTR* PFN_vkBindImageMemory)(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); +typedef void(VKAPI_PTR* PFN_vkCmdBeginQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); +typedef void(VKAPI_PTR* PFN_vkCmdBindDescriptorSets)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets); +typedef void(VKAPI_PTR* PFN_vkCmdBindIndexBuffer)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); +typedef void(VKAPI_PTR* PFN_vkCmdBindPipeline)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); +typedef void(VKAPI_PTR* PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions); +typedef void(VKAPI_PTR* PFN_vkCmdCopyBufferToImage)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions); +typedef void(VKAPI_PTR* PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); +typedef void(VKAPI_PTR* PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions); +typedef void(VKAPI_PTR* PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); +typedef void(VKAPI_PTR* PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef void(VKAPI_PTR* PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); +typedef void(VKAPI_PTR* PFN_vkCmdEndQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); +typedef void(VKAPI_PTR* PFN_vkCmdExecuteCommands)(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); +typedef void(VKAPI_PTR* PFN_vkCmdFillBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); +typedef void(VKAPI_PTR* PFN_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); +typedef void(VKAPI_PTR* PFN_vkCmdPushConstants)(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues); +typedef void(VKAPI_PTR* PFN_vkCmdResetQueryPool)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); +typedef void(VKAPI_PTR* PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions); +typedef void(VKAPI_PTR* PFN_vkCmdUpdateBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData); +typedef void(VKAPI_PTR* PFN_vkCmdWriteTimestamp)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); +typedef VkResult(VKAPI_PTR* PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer); +typedef VkResult(VKAPI_PTR* PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView); +typedef VkResult(VKAPI_PTR* PFN_vkCreateCommandPool)(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool); +typedef VkResult(VKAPI_PTR* PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); +typedef VkResult(VKAPI_PTR* PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool); +typedef VkResult(VKAPI_PTR* PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout); +typedef VkResult(VKAPI_PTR* PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice); +typedef VkResult(VKAPI_PTR* PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); +typedef VkResult(VKAPI_PTR* PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage); +typedef VkResult(VKAPI_PTR* PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView); +typedef VkResult(VKAPI_PTR* PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache); +typedef VkResult(VKAPI_PTR* PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout); +typedef VkResult(VKAPI_PTR* PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool); +typedef VkResult(VKAPI_PTR* PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler); +typedef VkResult(VKAPI_PTR* PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore); +typedef VkResult(VKAPI_PTR* PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule); +typedef void(VKAPI_PTR* PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyCommandPool)(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyImage)(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroySampler)(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator); +typedef VkResult(VKAPI_PTR* PFN_vkDeviceWaitIdle)(VkDevice device); +typedef VkResult(VKAPI_PTR* PFN_vkEndCommandBuffer)(VkCommandBuffer commandBuffer); +typedef VkResult(VKAPI_PTR* PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkEnumerateInstanceLayerProperties)(uint32_t* pPropertyCount, VkLayerProperties* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); +typedef VkResult(VKAPI_PTR* PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); +typedef void(VKAPI_PTR* PFN_vkFreeCommandBuffers)(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); +typedef VkResult(VKAPI_PTR* PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets); +typedef void(VKAPI_PTR* PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements); +typedef void(VKAPI_PTR* PFN_vkGetDeviceMemoryCommitment)(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes); +typedef void(VKAPI_PTR* PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); +typedef PFN_vkVoidFunction(VKAPI_PTR* PFN_vkGetDeviceProcAddr)(VkDevice device, const char* pName); +typedef VkResult(VKAPI_PTR* PFN_vkGetFenceStatus)(VkDevice device, VkFence fence); +typedef void(VKAPI_PTR* PFN_vkGetImageMemoryRequirements)(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements); +typedef void(VKAPI_PTR* PFN_vkGetImageSubresourceLayout)(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties); +typedef VkResult(VKAPI_PTR* PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData); +typedef VkResult(VKAPI_PTR* PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags); +typedef VkResult(VKAPI_PTR* PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); +typedef VkResult(VKAPI_PTR* PFN_vkMapMemory)(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData); +typedef VkResult(VKAPI_PTR* PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches); +typedef VkResult(VKAPI_PTR* PFN_vkQueueSubmit)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); +typedef VkResult(VKAPI_PTR* PFN_vkQueueWaitIdle)(VkQueue queue); +typedef VkResult(VKAPI_PTR* PFN_vkResetCommandBuffer)(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); +typedef VkResult(VKAPI_PTR* PFN_vkResetCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); +typedef VkResult(VKAPI_PTR* PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); +typedef VkResult(VKAPI_PTR* PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences); +typedef void(VKAPI_PTR* PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory memory); +typedef void(VKAPI_PTR* PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies); +typedef VkResult(VKAPI_PTR* PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout); + +#ifndef VK_KHR_surface +#define VK_KHR_surface 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) +#define VK_COLORSPACE_SRGB_NONLINEAR_KHR VK_COLOR_SPACE_SRGB_NONLINEAR_KHR +typedef enum VkColorSpaceKHR +{ + VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, + VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104001, + VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT = 1000104002, + VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104003, + VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104004, + VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104005, + VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104006, + VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104007, + VK_COLOR_SPACE_HDR10_ST2084_EXT = 1000104008, + VK_COLOR_SPACE_DOLBYVISION_EXT = 1000104009, + VK_COLOR_SPACE_HDR10_HLG_EXT = 1000104010, + VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, + VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, + VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, + VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = 1000104014, + VK_COLOR_SPACE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkColorSpaceKHR; +typedef enum VkPresentModeKHR +{ + VK_PRESENT_MODE_IMMEDIATE_KHR = 0, + VK_PRESENT_MODE_MAILBOX_KHR = 1, + VK_PRESENT_MODE_FIFO_KHR = 2, + VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3, + VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000, + VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001, + VK_PRESENT_MODE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkPresentModeKHR; +typedef enum VkSurfaceTransformFlagBitsKHR +{ + VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, + VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, + VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, + VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, + VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, + VK_SURFACE_TRANSFORM_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkSurfaceTransformFlagBitsKHR; +typedef VkFlags VkSurfaceTransformFlagsKHR; +typedef enum VkCompositeAlphaFlagBitsKHR +{ + VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, + VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, + VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, + VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, + VK_COMPOSITE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkCompositeAlphaFlagBitsKHR; +typedef VkFlags VkCompositeAlphaFlagsKHR; +typedef struct VkSurfaceCapabilitiesKHR +{ + uint32_t minImageCount; + uint32_t maxImageCount; + VkExtent2D currentExtent; + VkExtent2D minImageExtent; + VkExtent2D maxImageExtent; + uint32_t maxImageArrayLayers; + VkSurfaceTransformFlagsKHR supportedTransforms; + VkSurfaceTransformFlagBitsKHR currentTransform; + VkCompositeAlphaFlagsKHR supportedCompositeAlpha; + VkImageUsageFlags supportedUsageFlags; +} VkSurfaceCapabilitiesKHR; +typedef struct VkSurfaceFormatKHR +{ + VkFormat format; + VkColorSpaceKHR colorSpace; +} VkSurfaceFormatKHR; +typedef void(VKAPI_PTR* PFN_vkDestroySurfaceKHR)(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes); +#endif // VK_KHR_surface + +#ifndef VK_KHR_swapchain +#define VK_KHR_swapchain 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) +typedef enum VkSwapchainCreateFlagBitsKHR +{ + VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX = 0x00000001, + VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkSwapchainCreateFlagBitsKHR; +typedef VkFlags VkSwapchainCreateFlagsKHR; +typedef struct VkSwapchainCreateInfoKHR +{ + VkStructureType sType; + const void* pNext; + VkSwapchainCreateFlagsKHR flags; + VkSurfaceKHR surface; + uint32_t minImageCount; + VkFormat imageFormat; + VkColorSpaceKHR imageColorSpace; + VkExtent2D imageExtent; + uint32_t imageArrayLayers; + VkImageUsageFlags imageUsage; + VkSharingMode imageSharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; + VkSurfaceTransformFlagBitsKHR preTransform; + VkCompositeAlphaFlagBitsKHR compositeAlpha; + VkPresentModeKHR presentMode; + VkBool32 clipped; + VkSwapchainKHR oldSwapchain; +} VkSwapchainCreateInfoKHR; +typedef struct VkPresentInfoKHR +{ + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore* pWaitSemaphores; + uint32_t swapchainCount; + const VkSwapchainKHR* pSwapchains; + const uint32_t* pImageIndices; + VkResult* pResults; +} VkPresentInfoKHR; +typedef VkResult(VKAPI_PTR* PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain); +typedef void(VKAPI_PTR* PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator); +typedef VkResult(VKAPI_PTR* PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages); +typedef VkResult(VKAPI_PTR* PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex); +typedef VkResult(VKAPI_PTR* PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR* pPresentInfo); +#endif // VK_KHR_swapchain + +#ifndef VK_KHR_android_surface +#define VK_KHR_android_surface 1 +struct ANativeWindow; +typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; +typedef struct VkAndroidSurfaceCreateInfoKHR +{ + VkStructureType sType; + const void* pNext; + VkAndroidSurfaceCreateFlagsKHR flags; + struct ANativeWindow* window; +} VkAndroidSurfaceCreateInfoKHR; +typedef VkResult(VKAPI_PTR* PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +#endif // VK_KHR_android_surface + +namespace ncnn { + +// vulkan loader entrypoint +extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; + +// vulkan global functions +extern PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties; +extern PFN_vkCreateInstance vkCreateInstance; +extern PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties; + +// Load vulkan driver dynamic library when driver_path is provided +// Load from env VK_ICD_FILENAMES and NCNN_VULKAN_DRIVER otherwise +// If failed, it will try system libvulkan and well-known library names +// The three vulkan base function pointers will be set on success +int load_vulkan_driver(const char* driver_path = 0); + +// Unload vulkan driver library and clear +void unload_vulkan_driver(); + +} // namespace ncnn + +#endif // NCNN_SIMPLEVK +#endif // NCNN_VULKAN + +#endif // NCNN_SIMPLEVK_H diff --git a/app/libs/ncnn/arm64-v8a/include/ncnn/vulkan_header_fix.h b/app/libs/ncnn/arm64-v8a/include/ncnn/vulkan_header_fix.h new file mode 100644 index 0000000..ab76467 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/include/ncnn/vulkan_header_fix.h @@ -0,0 +1,1701 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_VULKAN_HEADER_FIX_H +#define NCNN_VULKAN_HEADER_FIX_H + +// #include "platform.h" + +// This header contains new structure and function declearation to fix build with old vulkan sdk + +#ifndef VK_KHR_maintenance1 +#define VK_KHR_maintenance1 1 +typedef VkFlags VkCommandPoolTrimFlags; +typedef VkCommandPoolTrimFlags VkCommandPoolTrimFlagsKHR; +typedef void(VKAPI_PTR* PFN_vkTrimCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); +typedef PFN_vkTrimCommandPool PFN_vkTrimCommandPoolKHR; +#endif // VK_KHR_maintenance1 + +#ifndef VK_KHR_get_physical_device_properties2 +#define VK_KHR_get_physical_device_properties2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 (VkStructureType)1000059000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 (VkStructureType)1000059001 +#define VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 (VkStructureType)1000059002 +#define VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 (VkStructureType)1000059003 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 (VkStructureType)1000059004 +#define VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 (VkStructureType)1000059005 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 (VkStructureType)1000059006 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 +#define VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 +#define VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 +#define VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 +typedef struct VkPhysicalDeviceFeatures2 +{ + VkStructureType sType; + void* pNext; + VkPhysicalDeviceFeatures features; +} VkPhysicalDeviceFeatures2; +typedef struct VkPhysicalDeviceProperties2 +{ + VkStructureType sType; + void* pNext; + VkPhysicalDeviceProperties properties; +} VkPhysicalDeviceProperties2; +typedef struct VkFormatProperties2 +{ + VkStructureType sType; + void* pNext; + VkFormatProperties formatProperties; +} VkFormatProperties2; +typedef struct VkImageFormatProperties2 +{ + VkStructureType sType; + void* pNext; + VkImageFormatProperties imageFormatProperties; +} VkImageFormatProperties2; +typedef struct VkPhysicalDeviceImageFormatInfo2 +{ + VkStructureType sType; + const void* pNext; + VkFormat format; + VkImageType type; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkImageCreateFlags flags; +} VkPhysicalDeviceImageFormatInfo2; +typedef struct VkQueueFamilyProperties2 +{ + VkStructureType sType; + void* pNext; + VkQueueFamilyProperties queueFamilyProperties; +} VkQueueFamilyProperties2; +typedef struct VkPhysicalDeviceMemoryProperties2 +{ + VkStructureType sType; + void* pNext; + VkPhysicalDeviceMemoryProperties memoryProperties; +} VkPhysicalDeviceMemoryProperties2; +typedef VkPhysicalDeviceFeatures2 VkPhysicalDeviceFeatures2KHR; +typedef VkPhysicalDeviceProperties2 VkPhysicalDeviceProperties2KHR; +typedef VkFormatProperties2 VkFormatProperties2KHR; +typedef VkImageFormatProperties2 VkImageFormatProperties2KHR; +typedef VkPhysicalDeviceImageFormatInfo2 VkPhysicalDeviceImageFormatInfo2KHR; +typedef VkQueueFamilyProperties2 VkQueueFamilyProperties2KHR; +typedef VkPhysicalDeviceMemoryProperties2 VkPhysicalDeviceMemoryProperties2KHR; +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceFeatures2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceFormatProperties2)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceQueueFamilyProperties2)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceMemoryProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties); +typedef PFN_vkGetPhysicalDeviceFeatures2 PFN_vkGetPhysicalDeviceFeatures2KHR; +typedef PFN_vkGetPhysicalDeviceProperties2 PFN_vkGetPhysicalDeviceProperties2KHR; +typedef PFN_vkGetPhysicalDeviceFormatProperties2 PFN_vkGetPhysicalDeviceFormatProperties2KHR; +typedef PFN_vkGetPhysicalDeviceImageFormatProperties2 PFN_vkGetPhysicalDeviceImageFormatProperties2KHR; +typedef PFN_vkGetPhysicalDeviceQueueFamilyProperties2 PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR; +typedef PFN_vkGetPhysicalDeviceMemoryProperties2 PFN_vkGetPhysicalDeviceMemoryProperties2KHR; +#endif // VK_KHR_get_physical_device_properties2 + +#ifndef VK_KHR_external_memory_capabilities +#define VK_KHR_external_memory_capabilities 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO (VkStructureType)1000071000 +#define VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES (VkStructureType)1000071001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO (VkStructureType)1000071002 +#define VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES (VkStructureType)1000071003 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES (VkStructureType)1000071004 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO +#define VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO +#define VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES +#define VK_LUID_SIZE 8 +#define VK_LUID_SIZE_KHR VK_LUID_SIZE +typedef enum VkExternalMemoryHandleTypeFlagBits +{ + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 0x00000008, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 0x00000010, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 0x00000020, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 0x00000040, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT = 0x00000200, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID = 0x00000400, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA = 0x00000800, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV = 0x00001000, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryHandleTypeFlagBits; +typedef VkFlags VkExternalMemoryHandleTypeFlags; +typedef enum VkExternalMemoryFeatureFlagBits +{ + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryFeatureFlagBits; +typedef VkFlags VkExternalMemoryFeatureFlags; +typedef struct VkExternalMemoryProperties +{ + VkExternalMemoryFeatureFlags externalMemoryFeatures; + VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes; + VkExternalMemoryHandleTypeFlags compatibleHandleTypes; +} VkExternalMemoryProperties; +typedef struct VkPhysicalDeviceExternalImageFormatInfo +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalImageFormatInfo; +typedef struct VkExternalImageFormatProperties +{ + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalImageFormatProperties; +typedef struct VkPhysicalDeviceExternalBufferInfo +{ + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkBufferUsageFlags usage; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalBufferInfo; +typedef struct VkExternalBufferProperties +{ + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalBufferProperties; +typedef struct VkPhysicalDeviceIDProperties +{ + VkStructureType sType; + void* pNext; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE]; + uint32_t deviceNodeMask; + VkBool32 deviceLUIDValid; +} VkPhysicalDeviceIDProperties; +typedef VkExternalMemoryHandleTypeFlags VkExternalMemoryHandleTypeFlagsKHR; +typedef VkExternalMemoryHandleTypeFlagBits VkExternalMemoryHandleTypeFlagBitsKHR; +typedef VkExternalMemoryFeatureFlags VkExternalMemoryFeatureFlagsKHR; +typedef VkExternalMemoryFeatureFlagBits VkExternalMemoryFeatureFlagBitsKHR; +typedef VkExternalMemoryProperties VkExternalMemoryPropertiesKHR; +typedef VkPhysicalDeviceExternalImageFormatInfo VkPhysicalDeviceExternalImageFormatInfoKHR; +typedef VkExternalImageFormatProperties VkExternalImageFormatPropertiesKHR; +typedef VkPhysicalDeviceExternalBufferInfo VkPhysicalDeviceExternalBufferInfoKHR; +typedef VkExternalBufferProperties VkExternalBufferPropertiesKHR; +typedef VkPhysicalDeviceIDProperties VkPhysicalDeviceIDPropertiesKHR; +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); +typedef PFN_vkGetPhysicalDeviceExternalBufferProperties PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR; +#endif // VK_KHR_external_memory_capabilities + +#ifndef VK_KHR_external_memory +#define VK_KHR_external_memory 1 +#define VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO (VkStructureType)1000072000 +#define VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO (VkStructureType)1000072001 +#define VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO (VkStructureType)1000072002 +#define VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO +#define VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO +#define VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO +#define VK_QUEUE_FAMILY_EXTERNAL_KHR (~0U - 1) +typedef struct VkExternalMemoryImageCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExternalMemoryImageCreateInfo; +typedef struct VkExternalMemoryBufferCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExternalMemoryBufferCreateInfo; +typedef struct VkExportMemoryAllocateInfo +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExportMemoryAllocateInfo; +typedef VkExternalMemoryImageCreateInfo VkExternalMemoryImageCreateInfoKHR; +typedef VkExternalMemoryBufferCreateInfo VkExternalMemoryBufferCreateInfoKHR; +typedef VkExportMemoryAllocateInfo VkExportMemoryAllocateInfoKHR; +#endif // VK_KHR_external_memory + +#ifndef VK_KHR_descriptor_update_template +#define VK_KHR_descriptor_update_template 1 +#define VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO (VkStructureType)1000085000 +#define VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) +typedef VkDescriptorUpdateTemplate VkDescriptorUpdateTemplateKHR; +typedef enum VkDescriptorUpdateTemplateType +{ + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET = 0, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorUpdateTemplateType; +typedef VkFlags VkDescriptorUpdateTemplateCreateFlags; +typedef struct VkDescriptorUpdateTemplateEntry +{ + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + size_t offset; + size_t stride; +} VkDescriptorUpdateTemplateEntry; +typedef struct VkDescriptorUpdateTemplateCreateInfo +{ + VkStructureType sType; + void* pNext; + VkDescriptorUpdateTemplateCreateFlags flags; + uint32_t descriptorUpdateEntryCount; + const VkDescriptorUpdateTemplateEntry* pDescriptorUpdateEntries; + VkDescriptorUpdateTemplateType templateType; + VkDescriptorSetLayout descriptorSetLayout; + VkPipelineBindPoint pipelineBindPoint; + VkPipelineLayout pipelineLayout; + uint32_t set; +} VkDescriptorUpdateTemplateCreateInfo; +typedef VkDescriptorUpdateTemplateType VkDescriptorUpdateTemplateTypeKHR; +typedef VkDescriptorUpdateTemplateCreateFlags VkDescriptorUpdateTemplateCreateFlagsKHR; +typedef VkDescriptorUpdateTemplateEntry VkDescriptorUpdateTemplateEntryKHR; +typedef VkDescriptorUpdateTemplateCreateInfo VkDescriptorUpdateTemplateCreateInfoKHR; +typedef VkResult(VKAPI_PTR* PFN_vkCreateDescriptorUpdateTemplate)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); +typedef void(VKAPI_PTR* PFN_vkDestroyDescriptorUpdateTemplate)(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkUpdateDescriptorSetWithTemplate)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); +typedef PFN_vkCreateDescriptorUpdateTemplate PFN_vkCreateDescriptorUpdateTemplateKHR; +typedef PFN_vkDestroyDescriptorUpdateTemplate PFN_vkDestroyDescriptorUpdateTemplateKHR; +typedef PFN_vkUpdateDescriptorSetWithTemplate PFN_vkUpdateDescriptorSetWithTemplateKHR; +#endif // VK_KHR_descriptor_update_template + +#ifndef VK_KHR_push_descriptor +#define VK_KHR_push_descriptor 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR (VkStructureType)1000080000 +typedef struct VkPhysicalDevicePushDescriptorPropertiesKHR +{ + VkStructureType sType; + void* pNext; + uint32_t maxPushDescriptors; +} VkPhysicalDevicePushDescriptorPropertiesKHR; +typedef void(VKAPI_PTR* PFN_vkCmdPushDescriptorSetKHR)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); +typedef void(VKAPI_PTR* PFN_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); +#endif // VK_KHR_push_descriptor + +#ifndef VK_KHR_get_surface_capabilities2 +#define VK_KHR_get_surface_capabilities2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR (VkStructureType)1000119000 +#define VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR (VkStructureType)1000119001 +#define VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR (VkStructureType)1000119002 +typedef struct VkPhysicalDeviceSurfaceInfo2KHR +{ + VkStructureType sType; + const void* pNext; + VkSurfaceKHR surface; +} VkPhysicalDeviceSurfaceInfo2KHR; +typedef struct VkSurfaceCapabilities2KHR +{ + VkStructureType sType; + void* pNext; + VkSurfaceCapabilitiesKHR surfaceCapabilities; +} VkSurfaceCapabilities2KHR; +typedef struct VkSurfaceFormat2KHR +{ + VkStructureType sType; + void* pNext; + VkSurfaceFormatKHR surfaceFormat; +} VkSurfaceFormat2KHR; +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats); +#endif // VK_KHR_get_surface_capabilities2 + +#ifndef VK_KHR_external_memory_capabilities +#define VK_KHR_external_memory_capabilities 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO (VkStructureType)1000071000 +#define VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES (VkStructureType)1000071001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO (VkStructureType)1000071002 +#define VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES (VkStructureType)1000071003 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES (VkStructureType)1000071004 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO +#define VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO +#define VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES +#define VK_LUID_SIZE 8U +#define VK_LUID_SIZE_KHR VK_LUID_SIZE +typedef enum VkExternalMemoryHandleTypeFlagBits +{ + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 0x00000008, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 0x00000010, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 0x00000020, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 0x00000040, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT = 0x00000200, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID = 0x00000400, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA = 0x00000800, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV = 0x00001000, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryHandleTypeFlagBits; +typedef VkFlags VkExternalMemoryHandleTypeFlags; +typedef enum VkExternalMemoryFeatureFlagBits +{ + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryFeatureFlagBits; +typedef VkFlags VkExternalMemoryFeatureFlags; +typedef struct VkExternalMemoryProperties +{ + VkExternalMemoryFeatureFlags externalMemoryFeatures; + VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes; + VkExternalMemoryHandleTypeFlags compatibleHandleTypes; +} VkExternalMemoryProperties; +typedef struct VkPhysicalDeviceExternalImageFormatInfo +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalImageFormatInfo; +typedef struct VkExternalImageFormatProperties +{ + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalImageFormatProperties; +typedef struct VkPhysicalDeviceExternalBufferInfo +{ + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkBufferUsageFlags usage; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalBufferInfo; +typedef struct VkExternalBufferProperties +{ + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalBufferProperties; +typedef struct VkPhysicalDeviceIDProperties +{ + VkStructureType sType; + void* pNext; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE]; + uint32_t deviceNodeMask; + VkBool32 deviceLUIDValid; +} VkPhysicalDeviceIDProperties; +typedef VkExternalMemoryHandleTypeFlags VkExternalMemoryHandleTypeFlagsKHR; +typedef VkExternalMemoryHandleTypeFlagBits VkExternalMemoryHandleTypeFlagBitsKHR; +typedef VkExternalMemoryFeatureFlags VkExternalMemoryFeatureFlagsKHR; +typedef VkExternalMemoryFeatureFlagBits VkExternalMemoryFeatureFlagBitsKHR; +typedef VkExternalMemoryProperties VkExternalMemoryPropertiesKHR; +typedef VkPhysicalDeviceExternalImageFormatInfo VkPhysicalDeviceExternalImageFormatInfoKHR; +typedef VkExternalImageFormatProperties VkExternalImageFormatPropertiesKHR; +typedef VkPhysicalDeviceExternalBufferInfo VkPhysicalDeviceExternalBufferInfoKHR; +typedef VkExternalBufferProperties VkExternalBufferPropertiesKHR; +typedef VkPhysicalDeviceIDProperties VkPhysicalDeviceIDPropertiesKHR; +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); +typedef PFN_vkGetPhysicalDeviceExternalBufferProperties PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR; +#endif // VK_KHR_external_memory_capabilities + +#ifndef VK_KHR_get_memory_requirements2 +#define VK_KHR_get_memory_requirements2 1 +#define VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 (VkStructureType)1000146000 +#define VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 (VkStructureType)1000146001 +#define VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 (VkStructureType)1000146003 +#define VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 +#define VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 +#define VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 +typedef struct VkBufferMemoryRequirementsInfo2 +{ + VkStructureType sType; + const void* pNext; + VkBuffer buffer; +} VkBufferMemoryRequirementsInfo2; +typedef struct VkImageMemoryRequirementsInfo2 +{ + VkStructureType sType; + const void* pNext; + VkImage image; +} VkImageMemoryRequirementsInfo2; +typedef struct VkMemoryRequirements2 +{ + VkStructureType sType; + void* pNext; + VkMemoryRequirements memoryRequirements; +} VkMemoryRequirements2; +typedef VkBufferMemoryRequirementsInfo2 VkBufferMemoryRequirementsInfo2KHR; +typedef VkImageMemoryRequirementsInfo2 VkImageMemoryRequirementsInfo2KHR; +typedef VkMemoryRequirements2 VkMemoryRequirements2KHR; +typedef void(VKAPI_PTR* PFN_vkGetImageMemoryRequirements2)(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void(VKAPI_PTR* PFN_vkGetBufferMemoryRequirements2)(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef PFN_vkGetImageMemoryRequirements2 PFN_vkGetImageMemoryRequirements2KHR; +typedef PFN_vkGetBufferMemoryRequirements2 PFN_vkGetBufferMemoryRequirements2KHR; +#endif // VK_KHR_get_memory_requirements2 + +#ifndef VK_KHR_dedicated_allocation +#define VK_KHR_dedicated_allocation 1 +#define VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS (VkStructureType)1000127000 +#define VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO (VkStructureType)1000127001 +#define VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS +#define VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO +typedef struct VkMemoryDedicatedRequirements +{ + VkStructureType sType; + void* pNext; + VkBool32 prefersDedicatedAllocation; + VkBool32 requiresDedicatedAllocation; +} VkMemoryDedicatedRequirements; +typedef struct VkMemoryDedicatedAllocateInfo +{ + VkStructureType sType; + const void* pNext; + VkImage image; + VkBuffer buffer; +} VkMemoryDedicatedAllocateInfo; +typedef VkMemoryDedicatedRequirements VkMemoryDedicatedRequirementsKHR; +typedef VkMemoryDedicatedAllocateInfo VkMemoryDedicatedAllocateInfoKHR; +#endif // VK_KHR_dedicated_allocation + +#ifndef VK_KHR_16bit_storage +#define VK_KHR_16bit_storage 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES (VkStructureType)1000083000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES +typedef struct VkPhysicalDevice16BitStorageFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 storageBuffer16BitAccess; + VkBool32 uniformAndStorageBuffer16BitAccess; + VkBool32 storagePushConstant16; + VkBool32 storageInputOutput16; +} VkPhysicalDevice16BitStorageFeatures; +typedef VkPhysicalDevice16BitStorageFeatures VkPhysicalDevice16BitStorageFeaturesKHR; +#endif // VK_KHR_16bit_storage + +#ifndef VK_KHR_bind_memory2 +#define VK_KHR_bind_memory2 1 +#define VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO (VkStructureType)1000157000 +#define VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO (VkStructureType)1000157001 +#define VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO +#define VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO +typedef struct VkBindBufferMemoryInfo +{ + VkStructureType sType; + const void* pNext; + VkBuffer buffer; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; +} VkBindBufferMemoryInfo; +typedef struct VkBindImageMemoryInfo +{ + VkStructureType sType; + const void* pNext; + VkImage image; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; +} VkBindImageMemoryInfo; +typedef VkBindBufferMemoryInfo VkBindBufferMemoryInfoKHR; +typedef VkBindImageMemoryInfo VkBindImageMemoryInfoKHR; +typedef VkResult(VKAPI_PTR* PFN_vkBindBufferMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos); +typedef VkResult(VKAPI_PTR* PFN_vkBindImageMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos); +typedef PFN_vkBindBufferMemory2 PFN_vkBindBufferMemory2KHR; +typedef PFN_vkBindImageMemory2 PFN_vkBindImageMemory2KHR; +#endif // VK_KHR_bind_memory2 + +#ifndef VK_KHR_sampler_ycbcr_conversion +#define VK_KHR_sampler_ycbcr_conversion 1 +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO (VkStructureType)1000156000 +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO (VkStructureType)1000156001 +#define VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO (VkStructureType)1000156002 +#define VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO (VkStructureType)1000156003 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES (VkStructureType)1000156004 +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES (VkStructureType)1000156005 +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO +#define VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO +#define VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) +typedef VkSamplerYcbcrConversion VkSamplerYcbcrConversionKHR; +typedef enum VkSamplerYcbcrModelConversion +{ + VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY = 0, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY = 1, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709 = 2, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 = 3, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 = 4, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM = 0x7FFFFFFF +} VkSamplerYcbcrModelConversion; +typedef enum VkSamplerYcbcrRange +{ + VK_SAMPLER_YCBCR_RANGE_ITU_FULL = 0, + VK_SAMPLER_YCBCR_RANGE_ITU_NARROW = 1, + VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, + VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW, + VK_SAMPLER_YCBCR_RANGE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerYcbcrRange; +typedef enum VkChromaLocation +{ + VK_CHROMA_LOCATION_COSITED_EVEN = 0, + VK_CHROMA_LOCATION_MIDPOINT = 1, + VK_CHROMA_LOCATION_COSITED_EVEN_KHR = VK_CHROMA_LOCATION_COSITED_EVEN, + VK_CHROMA_LOCATION_MIDPOINT_KHR = VK_CHROMA_LOCATION_MIDPOINT, + VK_CHROMA_LOCATION_MAX_ENUM = 0x7FFFFFFF +} VkChromaLocation; +typedef struct VkSamplerYcbcrConversionCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkFormat format; + VkSamplerYcbcrModelConversion ycbcrModel; + VkSamplerYcbcrRange ycbcrRange; + VkComponentMapping components; + VkChromaLocation xChromaOffset; + VkChromaLocation yChromaOffset; + VkFilter chromaFilter; + VkBool32 forceExplicitReconstruction; +} VkSamplerYcbcrConversionCreateInfo; +typedef struct VkSamplerYcbcrConversionInfo +{ + VkStructureType sType; + const void* pNext; + VkSamplerYcbcrConversion conversion; +} VkSamplerYcbcrConversionInfo; +typedef struct VkBindImagePlaneMemoryInfo +{ + VkStructureType sType; + const void* pNext; + VkImageAspectFlagBits planeAspect; +} VkBindImagePlaneMemoryInfo; +typedef struct VkImagePlaneMemoryRequirementsInfo +{ + VkStructureType sType; + const void* pNext; + VkImageAspectFlagBits planeAspect; +} VkImagePlaneMemoryRequirementsInfo; +typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 samplerYcbcrConversion; +} VkPhysicalDeviceSamplerYcbcrConversionFeatures; +typedef struct VkSamplerYcbcrConversionImageFormatProperties +{ + VkStructureType sType; + void* pNext; + uint32_t combinedImageSamplerDescriptorCount; +} VkSamplerYcbcrConversionImageFormatProperties; +typedef VkSamplerYcbcrModelConversion VkSamplerYcbcrModelConversionKHR; +typedef VkSamplerYcbcrRange VkSamplerYcbcrRangeKHR; +typedef VkChromaLocation VkChromaLocationKHR; +typedef VkSamplerYcbcrConversionCreateInfo VkSamplerYcbcrConversionCreateInfoKHR; +typedef VkSamplerYcbcrConversionInfo VkSamplerYcbcrConversionInfoKHR; +typedef VkBindImagePlaneMemoryInfo VkBindImagePlaneMemoryInfoKHR; +typedef VkImagePlaneMemoryRequirementsInfo VkImagePlaneMemoryRequirementsInfoKHR; +typedef VkPhysicalDeviceSamplerYcbcrConversionFeatures VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR; +typedef VkSamplerYcbcrConversionImageFormatProperties VkSamplerYcbcrConversionImageFormatPropertiesKHR; +typedef VkResult(VKAPI_PTR* PFN_vkCreateSamplerYcbcrConversion)(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion); +typedef void(VKAPI_PTR* PFN_vkDestroySamplerYcbcrConversion)(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator); +typedef PFN_vkCreateSamplerYcbcrConversion PFN_vkCreateSamplerYcbcrConversionKHR; +typedef PFN_vkDestroySamplerYcbcrConversion PFN_vkDestroySamplerYcbcrConversionKHR; +#endif // VK_KHR_sampler_ycbcr_conversion + +#if VK_HEADER_VERSION < 70 +// the unpublished VK_KHR_subgroup +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES (VkStructureType)1000094000 +typedef enum VkSubgroupFeatureFlagBits +{ + VK_SUBGROUP_FEATURE_BASIC_BIT = 0x00000001, + VK_SUBGROUP_FEATURE_VOTE_BIT = 0x00000002, + VK_SUBGROUP_FEATURE_ARITHMETIC_BIT = 0x00000004, + VK_SUBGROUP_FEATURE_BALLOT_BIT = 0x00000008, + VK_SUBGROUP_FEATURE_SHUFFLE_BIT = 0x00000010, + VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = 0x00000020, + VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 0x00000040, + VK_SUBGROUP_FEATURE_QUAD_BIT = 0x00000080, + VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100, + VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSubgroupFeatureFlagBits; +typedef VkFlags VkSubgroupFeatureFlags; +typedef struct VkPhysicalDeviceSubgroupProperties +{ + VkStructureType sType; + void* pNext; + uint32_t subgroupSize; + VkShaderStageFlags supportedStages; + VkSubgroupFeatureFlags supportedOperations; + VkBool32 quadOperationsInAllStages; +} VkPhysicalDeviceSubgroupProperties; + +// the unpublished VK_KHR_protected_memory +#define VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO (VkStructureType)1000145000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES (VkStructureType)1000145001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES (VkStructureType)1000145002 +#define VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2 (VkStructureType)1000145003 +#define VK_MEMORY_PROPERTY_PROTECTED_BIT (VkMemoryPropertyFlagBits)0x00000020 +#define VK_IMAGE_CREATE_PROTECTED_BIT (VkImageCreateFlagBits)0x00000800 +#define VK_BUFFER_CREATE_PROTECTED_BIT (VkBufferCreateFlagBits)0x00000008 +#define VK_QUEUE_PROTECTED_BIT (VkQueueFlagBits)0x00000010 +#define VK_COMMAND_POOL_CREATE_PROTECTED_BIT (VkCommandPoolCreateFlagBits)0x00000004 +typedef enum VkDeviceQueueCreateFlagBits +{ + VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT = 0x00000001, + VK_DEVICE_QUEUE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDeviceQueueCreateFlagBits; +typedef VkFlags VkDeviceQueueCreateFlags; +typedef struct VkPhysicalDeviceProtectedMemoryFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 protectedMemory; +} VkPhysicalDeviceProtectedMemoryFeatures; +typedef struct VkPhysicalDeviceProtectedMemoryProperties +{ + VkStructureType sType; + void* pNext; + VkBool32 protectedNoFault; +} VkPhysicalDeviceProtectedMemoryProperties; +typedef struct VkProtectedSubmitInfo +{ + VkStructureType sType; + const void* pNext; + VkBool32 protectedSubmit; +} VkProtectedSubmitInfo; +#endif // VK_HEADER_VERSION < 70 + +#if VK_HEADER_VERSION < 204 +typedef uint64_t VkFlags64; +#endif // VK_HEADER_VERSION < 204 + +#ifndef VK_KHR_format_feature_flags2 +#define VK_KHR_format_feature_flags2 1 +#define VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3 (VkStructureType)1000360000 +#define VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3 +typedef VkFlags64 VkFormatFeatureFlags2; +typedef VkFlags64 VkFormatFeatureFlagBits2; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT = 0x00000001ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR = 0x00000001ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT = 0x00000002ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR = 0x00000002ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHR = 0x00000004ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR = 0x00000008ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT = 0x00000010ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR = 0x00000010ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHR = 0x00000020ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT = 0x00000040ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHR = 0x00000040ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT = 0x00000080ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR = 0x00000080ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHR = 0x00000100ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR = 0x00000200ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT = 0x00000400ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR = 0x00000400ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT = 0x00000800ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT_KHR = 0x00000800ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHR = 0x00001000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT = 0x00002000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT = 0x00004000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR = 0x00004000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT = 0x00008000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR = 0x00008000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 0x00010000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHR = 0x00010000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT = 0x00020000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = 0x00020000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 0x00040000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = 0x00040000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 0x00080000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = 0x00080000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 0x00100000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = 0x00100000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 0x00200000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = 0x00200000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT = 0x00400000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT_KHR = 0x00400000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT = 0x00800000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHR = 0x00800000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT = 0x80000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR = 0x80000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT = 0x100000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR = 0x100000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT = 0x200000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR = 0x200000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV = 0x4000000000ULL; +typedef struct VkFormatProperties3 +{ + VkStructureType sType; + void* pNext; + VkFormatFeatureFlags2 linearTilingFeatures; + VkFormatFeatureFlags2 optimalTilingFeatures; + VkFormatFeatureFlags2 bufferFeatures; +} VkFormatProperties3; +typedef VkFormatFeatureFlags2 VkFormatFeatureFlags2KHR; +typedef VkFormatFeatureFlagBits2 VkFormatFeatureFlagBits2KHR; +typedef VkFormatProperties3 VkFormatProperties3KHR; +#endif // VK_KHR_format_feature_flags2 + +#ifndef VK_ANDROID_external_memory_android_hardware_buffer +#define VK_ANDROID_external_memory_android_hardware_buffer 1 +#define VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID (VkStructureType)1000129000 +#define VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID (VkStructureType)1000129001 +#define VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID (VkStructureType)1000129002 +#define VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID (VkStructureType)1000129003 +#define VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID (VkStructureType)1000129004 +#define VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID (VkStructureType)1000129005 +#define VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID (VkStructureType)1000129006 +struct AHardwareBuffer; +typedef struct VkAndroidHardwareBufferUsageANDROID +{ + VkStructureType sType; + void* pNext; + uint64_t androidHardwareBufferUsage; +} VkAndroidHardwareBufferUsageANDROID; +typedef struct VkAndroidHardwareBufferPropertiesANDROID +{ + VkStructureType sType; + void* pNext; + VkDeviceSize allocationSize; + uint32_t memoryTypeBits; +} VkAndroidHardwareBufferPropertiesANDROID; +typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID +{ + VkStructureType sType; + void* pNext; + VkFormat format; + uint64_t externalFormat; + VkFormatFeatureFlags formatFeatures; + VkComponentMapping samplerYcbcrConversionComponents; + VkSamplerYcbcrModelConversion suggestedYcbcrModel; + VkSamplerYcbcrRange suggestedYcbcrRange; + VkChromaLocation suggestedXChromaOffset; + VkChromaLocation suggestedYChromaOffset; +} VkAndroidHardwareBufferFormatPropertiesANDROID; +typedef struct VkImportAndroidHardwareBufferInfoANDROID +{ + VkStructureType sType; + const void* pNext; + struct AHardwareBuffer* buffer; +} VkImportAndroidHardwareBufferInfoANDROID; +typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID +{ + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; +} VkMemoryGetAndroidHardwareBufferInfoANDROID; +typedef struct VkExternalFormatANDROID +{ + VkStructureType sType; + void* pNext; + uint64_t externalFormat; +} VkExternalFormatANDROID; +typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID +{ + VkStructureType sType; + void* pNext; + VkFormat format; + uint64_t externalFormat; + VkFormatFeatureFlags2 formatFeatures; + VkComponentMapping samplerYcbcrConversionComponents; + VkSamplerYcbcrModelConversion suggestedYcbcrModel; + VkSamplerYcbcrRange suggestedYcbcrRange; + VkChromaLocation suggestedXChromaOffset; + VkChromaLocation suggestedYChromaOffset; +} VkAndroidHardwareBufferFormatProperties2ANDROID; +typedef VkResult(VKAPI_PTR* PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer); +#endif // VK_ANDROID_external_memory_android_hardware_buffer + +#ifndef VK_KHR_maintenance3 +#define VK_KHR_maintenance3 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES (VkStructureType)1000168000 +#define VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT (VkStructureType)1000168001 +typedef struct VkPhysicalDeviceMaintenance3Properties +{ + VkStructureType sType; + void* pNext; + uint32_t maxPerSetDescriptors; + VkDeviceSize maxMemoryAllocationSize; +} VkPhysicalDeviceMaintenance3Properties; +typedef struct VkDescriptorSetLayoutSupport +{ + VkStructureType sType; + void* pNext; + VkBool32 supported; +} VkDescriptorSetLayoutSupport; +typedef VkPhysicalDeviceMaintenance3Properties VkPhysicalDeviceMaintenance3PropertiesKHR; +typedef VkDescriptorSetLayoutSupport VkDescriptorSetLayoutSupportKHR; +typedef void(VKAPI_PTR* PFN_vkGetDescriptorSetLayoutSupport)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport); +typedef PFN_vkGetDescriptorSetLayoutSupport PFN_vkGetDescriptorSetLayoutSupportKHR; +#endif // VK_KHR_maintenance3 + +#ifndef VK_KHR_8bit_storage +#define VK_KHR_8bit_storage 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES (VkStructureType)1000177000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES +typedef struct VkPhysicalDevice8BitStorageFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 storageBuffer8BitAccess; + VkBool32 uniformAndStorageBuffer8BitAccess; + VkBool32 storagePushConstant8; +} VkPhysicalDevice8BitStorageFeatures; +typedef VkPhysicalDevice8BitStorageFeatures VkPhysicalDevice8BitStorageFeaturesKHR; +#endif // VK_KHR_8bit_storage + +#ifndef VK_KHR_shader_float16_int8 +#define VK_KHR_shader_float16_int8 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES (VkStructureType)1000082000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES +typedef struct VkPhysicalDeviceFloat16Int8FeaturesKHR +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderFloat16; + VkBool32 shaderInt8; +} VkPhysicalDeviceFloat16Int8FeaturesKHR; +#endif // VK_KHR_shader_float16_int8 + +#ifndef VK_EXT_memory_budget +#define VK_EXT_memory_budget 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT (VkStructureType)1000237000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT (VkStructureType)1000238000 +#define VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT (VkStructureType)1000238001 +typedef uint64_t VkDeviceAddress; +typedef struct VkPhysicalDeviceMemoryBudgetPropertiesEXT +{ + VkStructureType sType; + void* pNext; + VkDeviceSize heapBudget[VK_MAX_MEMORY_HEAPS]; + VkDeviceSize heapUsage[VK_MAX_MEMORY_HEAPS]; +} VkPhysicalDeviceMemoryBudgetPropertiesEXT; +typedef struct VkPhysicalDeviceMemoryPriorityFeaturesEXT +{ + VkStructureType sType; + void* pNext; + VkBool32 memoryPriority; +} VkPhysicalDeviceMemoryPriorityFeaturesEXT; +typedef struct VkMemoryPriorityAllocateInfoEXT +{ + VkStructureType sType; + const void* pNext; + float priority; +} VkMemoryPriorityAllocateInfoEXT; +#endif // VK_EXT_memory_budget + +#ifndef VK_EXT_buffer_device_address +#define VK_EXT_buffer_device_address 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT (VkStructureType)1000244000 +#define VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT (VkStructureType)1000244001 +#define VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT (VkStructureType)1000244002 +#define VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT (VkBufferUsageFlagBits)0x00020000 +typedef struct VkPhysicalDeviceBufferAddressFeaturesEXT +{ + VkStructureType sType; + void* pNext; + VkBool32 bufferDeviceAddress; + VkBool32 bufferDeviceAddressCaptureReplay; + VkBool32 bufferDeviceAddressMultiDevice; +} VkPhysicalDeviceBufferAddressFeaturesEXT; +typedef struct VkBufferDeviceAddressInfoEXT +{ + VkStructureType sType; + const void* pNext; + VkBuffer buffer; +} VkBufferDeviceAddressInfoEXT; +typedef struct VkBufferDeviceAddressCreateInfoEXT +{ + VkStructureType sType; + const void* pNext; + VkDeviceSize deviceAddress; +} VkBufferDeviceAddressCreateInfoEXT; +typedef VkDeviceAddress(VKAPI_PTR* PFN_vkGetBufferDeviceAddressEXT)(VkDevice device, const VkBufferDeviceAddressInfoEXT* pInfo); +#endif // VK_EXT_buffer_device_address + +#ifndef VK_EXT_validation_features +#define VK_EXT_validation_features 1 +#define VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT (VkStructureType)1000247000 +#define VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT (VkBufferCreateFlagBits)0x00020000 +typedef enum VkValidationFeatureEnableEXT +{ + VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT = 0, + VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT = 1, + VK_VALIDATION_FEATURE_ENABLE_BEGIN_RANGE_EXT = VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT, + VK_VALIDATION_FEATURE_ENABLE_END_RANGE_EXT = VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT, + VK_VALIDATION_FEATURE_ENABLE_RANGE_SIZE_EXT = (VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT - VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT + 1), + VK_VALIDATION_FEATURE_ENABLE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationFeatureEnableEXT; +typedef enum VkValidationFeatureDisableEXT +{ + VK_VALIDATION_FEATURE_DISABLE_ALL_EXT = 0, + VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT = 1, + VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT = 2, + VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT = 3, + VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT = 4, + VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT = 5, + VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT = 6, + VK_VALIDATION_FEATURE_DISABLE_BEGIN_RANGE_EXT = VK_VALIDATION_FEATURE_DISABLE_ALL_EXT, + VK_VALIDATION_FEATURE_DISABLE_END_RANGE_EXT = VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT, + VK_VALIDATION_FEATURE_DISABLE_RANGE_SIZE_EXT = (VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT - VK_VALIDATION_FEATURE_DISABLE_ALL_EXT + 1), + VK_VALIDATION_FEATURE_DISABLE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationFeatureDisableEXT; +typedef struct VkValidationFeaturesEXT +{ + VkStructureType sType; + const void* pNext; + uint32_t enabledValidationFeatureCount; + const VkValidationFeatureEnableEXT* pEnabledValidationFeatures; + uint32_t disabledValidationFeatureCount; + const VkValidationFeatureDisableEXT* pDisabledValidationFeatures; +} VkValidationFeaturesEXT; +#endif // VK_EXT_validation_features + +#ifndef VK_NV_cooperative_matrix +#define VK_NV_cooperative_matrix 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV (VkStructureType)1000249000 +#define VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV (VkStructureType)1000249001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV (VkStructureType)1000249002 +typedef enum VkComponentTypeNV +{ + VK_COMPONENT_TYPE_FLOAT16_NV = 0, + VK_COMPONENT_TYPE_FLOAT32_NV = 1, + VK_COMPONENT_TYPE_FLOAT64_NV = 2, + VK_COMPONENT_TYPE_SINT8_NV = 3, + VK_COMPONENT_TYPE_SINT16_NV = 4, + VK_COMPONENT_TYPE_SINT32_NV = 5, + VK_COMPONENT_TYPE_SINT64_NV = 6, + VK_COMPONENT_TYPE_UINT8_NV = 7, + VK_COMPONENT_TYPE_UINT16_NV = 8, + VK_COMPONENT_TYPE_UINT32_NV = 9, + VK_COMPONENT_TYPE_UINT64_NV = 10, + VK_COMPONENT_TYPE_BEGIN_RANGE_NV = VK_COMPONENT_TYPE_FLOAT16_NV, + VK_COMPONENT_TYPE_END_RANGE_NV = VK_COMPONENT_TYPE_UINT64_NV, + VK_COMPONENT_TYPE_RANGE_SIZE_NV = (VK_COMPONENT_TYPE_UINT64_NV - VK_COMPONENT_TYPE_FLOAT16_NV + 1), + VK_COMPONENT_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkComponentTypeNV; +typedef enum VkScopeNV +{ + VK_SCOPE_DEVICE_NV = 1, + VK_SCOPE_WORKGROUP_NV = 2, + VK_SCOPE_SUBGROUP_NV = 3, + VK_SCOPE_QUEUE_FAMILY_NV = 5, + VK_SCOPE_BEGIN_RANGE_NV = VK_SCOPE_DEVICE_NV, + VK_SCOPE_END_RANGE_NV = VK_SCOPE_QUEUE_FAMILY_NV, + VK_SCOPE_RANGE_SIZE_NV = (VK_SCOPE_QUEUE_FAMILY_NV - VK_SCOPE_DEVICE_NV + 1), + VK_SCOPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkScopeNV; +typedef struct VkCooperativeMatrixPropertiesNV +{ + VkStructureType sType; + void* pNext; + uint32_t MSize; + uint32_t NSize; + uint32_t KSize; + VkComponentTypeNV AType; + VkComponentTypeNV BType; + VkComponentTypeNV CType; + VkComponentTypeNV DType; + VkScopeNV scope; +} VkCooperativeMatrixPropertiesNV; +typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesNV +{ + VkStructureType sType; + void* pNext; + VkBool32 cooperativeMatrix; + VkBool32 cooperativeMatrixRobustBufferAccess; +} VkPhysicalDeviceCooperativeMatrixFeaturesNV; +typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesNV +{ + VkStructureType sType; + void* pNext; + VkShaderStageFlags cooperativeMatrixSupportedStages; +} VkPhysicalDeviceCooperativeMatrixPropertiesNV; +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesNV* pProperties); +#endif // VK_NV_cooperative_matrix + +#ifndef VK_AMD_device_coherent_memory +#define VK_AMD_device_coherent_memory 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD (VkStructureType)1000229000 +#define VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD (VkMemoryPropertyFlagBits)0x00000040 +#define VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD (VkMemoryPropertyFlagBits)0x00000040 +typedef struct VkPhysicalDeviceCoherentMemoryFeaturesAMD +{ + VkStructureType sType; + void* pNext; + VkBool32 deviceCoherentMemory; +} VkPhysicalDeviceCoherentMemoryFeaturesAMD; +#endif // VK_AMD_device_coherent_memory + +#ifndef VK_KHR_buffer_device_address +#define VK_KHR_buffer_device_address 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES (VkStructureType)1000257000 +#define VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO (VkStructureType)1000244001 +#define VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO (VkStructureType)1000257002 +#define VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO (VkStructureType)1000257003 +#define VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO (VkStructureType)1000257004 +#define VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT (VkBufferCreateFlagBits)0x00020000 +#define VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT (VkBufferUsageFlagBits)0x00020000 +#define VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT (VkMemoryAllocateFlagBits)0x00000002 +#define VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT (VkMemoryAllocateFlagBits)0x00000004 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES +#define VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO +#define VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO +#define VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO +#define VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO +#define VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT +#define VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT +#define VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT +#define VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT +typedef struct VkPhysicalDeviceBufferDeviceAddressFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 bufferDeviceAddress; + VkBool32 bufferDeviceAddressCaptureReplay; + VkBool32 bufferDeviceAddressMultiDevice; +} VkPhysicalDeviceBufferDeviceAddressFeatures; +typedef struct VkBufferDeviceAddressInfo +{ + VkStructureType sType; + const void* pNext; + VkBuffer buffer; +} VkBufferDeviceAddressInfo; +typedef struct VkBufferOpaqueCaptureAddressCreateInfo +{ + VkStructureType sType; + const void* pNext; + uint64_t opaqueCaptureAddress; +} VkBufferOpaqueCaptureAddressCreateInfo; +typedef struct VkMemoryOpaqueCaptureAddressAllocateInfo +{ + VkStructureType sType; + const void* pNext; + uint64_t opaqueCaptureAddress; +} VkMemoryOpaqueCaptureAddressAllocateInfo; +typedef struct VkDeviceMemoryOpaqueCaptureAddressInfo +{ + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; +} VkDeviceMemoryOpaqueCaptureAddressInfo; +typedef VkPhysicalDeviceBufferDeviceAddressFeatures VkPhysicalDeviceBufferDeviceAddressFeaturesKHR; +typedef VkBufferDeviceAddressInfo VkBufferDeviceAddressInfoKHR; +typedef VkBufferOpaqueCaptureAddressCreateInfo VkBufferOpaqueCaptureAddressCreateInfoKHR; +typedef VkMemoryOpaqueCaptureAddressAllocateInfo VkMemoryOpaqueCaptureAddressAllocateInfoKHR; +typedef VkDeviceMemoryOpaqueCaptureAddressInfo VkDeviceMemoryOpaqueCaptureAddressInfoKHR; +typedef VkDeviceAddress(VKAPI_PTR* PFN_vkGetBufferDeviceAddress)(VkDevice device, const VkBufferDeviceAddressInfo* pInfo); +typedef uint64_t(VKAPI_PTR* PFN_vkGetBufferOpaqueCaptureAddress)(VkDevice device, const VkBufferDeviceAddressInfo* pInfo); +typedef uint64_t(VKAPI_PTR* PFN_vkGetDeviceMemoryOpaqueCaptureAddress)(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo); +typedef PFN_vkGetBufferDeviceAddress PFN_vkGetBufferDeviceAddressKHR; +typedef PFN_vkGetBufferOpaqueCaptureAddress PFN_vkGetBufferOpaqueCaptureAddressKHR; +typedef PFN_vkGetDeviceMemoryOpaqueCaptureAddress PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR; +#endif // VK_KHR_buffer_device_address + +#ifndef VK_KHR_portability_enumeration +#define VK_KHR_portability_enumeration 1 +typedef enum VkInstanceCreateFlagBits +{ + VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR = 0x00000001, + VK_INSTANCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkInstanceCreateFlagBits; +#endif // VK_KHR_portability_enumeration + +#ifndef VK_KHR_cooperative_matrix +#define VK_KHR_cooperative_matrix 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR (VkStructureType)1000506000 +#define VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR (VkStructureType)1000506001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR (VkStructureType)1000506002 +typedef enum VkComponentTypeKHR +{ + VK_COMPONENT_TYPE_FLOAT16_KHR = 0, + VK_COMPONENT_TYPE_FLOAT32_KHR = 1, + VK_COMPONENT_TYPE_FLOAT64_KHR = 2, + VK_COMPONENT_TYPE_SINT8_KHR = 3, + VK_COMPONENT_TYPE_SINT16_KHR = 4, + VK_COMPONENT_TYPE_SINT32_KHR = 5, + VK_COMPONENT_TYPE_SINT64_KHR = 6, + VK_COMPONENT_TYPE_UINT8_KHR = 7, + VK_COMPONENT_TYPE_UINT16_KHR = 8, + VK_COMPONENT_TYPE_UINT32_KHR = 9, + VK_COMPONENT_TYPE_UINT64_KHR = 10, + VK_COMPONENT_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkComponentTypeKHR; +typedef enum VkScopeKHR +{ + VK_SCOPE_DEVICE_KHR = 1, + VK_SCOPE_WORKGROUP_KHR = 2, + VK_SCOPE_SUBGROUP_KHR = 3, + VK_SCOPE_QUEUE_FAMILY_KHR = 5, + VK_SCOPE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkScopeKHR; +typedef struct VkCooperativeMatrixPropertiesKHR +{ + VkStructureType sType; + void* pNext; + uint32_t MSize; + uint32_t NSize; + uint32_t KSize; + VkComponentTypeKHR AType; + VkComponentTypeKHR BType; + VkComponentTypeKHR CType; + VkComponentTypeKHR ResultType; + VkBool32 saturatingAccumulation; + VkScopeKHR scope; +} VkCooperativeMatrixPropertiesKHR; +typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesKHR +{ + VkStructureType sType; + void* pNext; + VkBool32 cooperativeMatrix; + VkBool32 cooperativeMatrixRobustBufferAccess; +} VkPhysicalDeviceCooperativeMatrixFeaturesKHR; +typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesKHR +{ + VkStructureType sType; + void* pNext; + VkShaderStageFlags cooperativeMatrixSupportedStages; +} VkPhysicalDeviceCooperativeMatrixPropertiesKHR; +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesKHR* pProperties); +#endif // VK_KHR_cooperative_matrix + +#ifndef VK_KHR_driver_properties +#define VK_KHR_driver_properties 1 +#define VK_MAX_DRIVER_NAME_SIZE 256U +#define VK_MAX_DRIVER_INFO_SIZE 256U +#define VK_MAX_DRIVER_NAME_SIZE_KHR VK_MAX_DRIVER_NAME_SIZE +#define VK_MAX_DRIVER_INFO_SIZE_KHR VK_MAX_DRIVER_INFO_SIZE +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES (VkStructureType)1000196000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES +typedef enum VkDriverId +{ + VK_DRIVER_ID_AMD_PROPRIETARY = 1, + VK_DRIVER_ID_AMD_OPEN_SOURCE = 2, + VK_DRIVER_ID_MESA_RADV = 3, + VK_DRIVER_ID_NVIDIA_PROPRIETARY = 4, + VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS = 5, + VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA = 6, + VK_DRIVER_ID_IMAGINATION_PROPRIETARY = 7, + VK_DRIVER_ID_QUALCOMM_PROPRIETARY = 8, + VK_DRIVER_ID_ARM_PROPRIETARY = 9, + VK_DRIVER_ID_GOOGLE_SWIFTSHADER = 10, + VK_DRIVER_ID_GGP_PROPRIETARY = 11, + VK_DRIVER_ID_BROADCOM_PROPRIETARY = 12, + VK_DRIVER_ID_MESA_LLVMPIPE = 13, + VK_DRIVER_ID_MOLTENVK = 14, + VK_DRIVER_ID_COREAVI_PROPRIETARY = 15, + VK_DRIVER_ID_JUICE_PROPRIETARY = 16, + VK_DRIVER_ID_VERISILICON_PROPRIETARY = 17, + VK_DRIVER_ID_MESA_TURNIP = 18, + VK_DRIVER_ID_MESA_V3DV = 19, + VK_DRIVER_ID_MESA_PANVK = 20, + VK_DRIVER_ID_SAMSUNG_PROPRIETARY = 21, + VK_DRIVER_ID_MESA_VENUS = 22, + VK_DRIVER_ID_MESA_DOZEN = 23, + VK_DRIVER_ID_MESA_NVK = 24, + VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA = 25, + VK_DRIVER_ID_MESA_AGXV = 26, + VK_DRIVER_ID_MAX_ENUM = 0x7FFFFFFF +} VkDriverId; +typedef struct VkConformanceVersion +{ + uint8_t major; + uint8_t minor; + uint8_t subminor; + uint8_t patch; +} VkConformanceVersion; +typedef struct VkPhysicalDeviceDriverProperties +{ + VkStructureType sType; + void* pNext; + VkDriverId driverID; + char driverName[VK_MAX_DRIVER_NAME_SIZE]; + char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; + VkConformanceVersion conformanceVersion; +} VkPhysicalDeviceDriverProperties; +typedef VkDriverId VkDriverIdKHR; +typedef VkConformanceVersion VkConformanceVersionKHR; +typedef VkPhysicalDeviceDriverProperties VkPhysicalDeviceDriverPropertiesKHR; +#endif // VK_KHR_driver_properties + +#ifndef VK_EXT_subgroup_size_control +#define VK_EXT_subgroup_size_control 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES (VkStructureType)1000225002 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES (VkStructureType)1000225000 +#define VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO (VkStructureType)1000225001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES +#define VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO +typedef enum VkPipelineShaderStageCreateFlagBits +{ + VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT = 0x00000001, + VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT = 0x00000002, + VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT, + VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT = VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT, + VK_PIPELINE_SHADER_STAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPipelineShaderStageCreateFlagBits; +typedef VkFlags VkPipelineShaderStageCreateFlags; +typedef struct VkPhysicalDeviceSubgroupSizeControlFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 subgroupSizeControl; + VkBool32 computeFullSubgroups; +} VkPhysicalDeviceSubgroupSizeControlFeatures; +typedef struct VkPhysicalDeviceSubgroupSizeControlProperties +{ + VkStructureType sType; + void* pNext; + uint32_t minSubgroupSize; + uint32_t maxSubgroupSize; + uint32_t maxComputeWorkgroupSubgroups; + VkShaderStageFlags requiredSubgroupSizeStages; +} VkPhysicalDeviceSubgroupSizeControlProperties; +typedef struct VkPipelineShaderStageRequiredSubgroupSizeCreateInfo +{ + VkStructureType sType; + void* pNext; + uint32_t requiredSubgroupSize; +} VkPipelineShaderStageRequiredSubgroupSizeCreateInfo; +typedef VkPhysicalDeviceSubgroupSizeControlFeatures VkPhysicalDeviceSubgroupSizeControlFeaturesEXT; +typedef VkPhysicalDeviceSubgroupSizeControlProperties VkPhysicalDeviceSubgroupSizeControlPropertiesEXT; +typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT; +#endif // VK_EXT_subgroup_size_control + +#ifndef VK_KHR_shader_subgroup_rotate +#define VK_KHR_shader_subgroup_rotate 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES (VkStructureType)1000416000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES +#define VK_SUBGROUP_FEATURE_ROTATE_BIT (VkSubgroupFeatureFlagBits)0x00000200 +#define VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT (VkSubgroupFeatureFlagBits)0x00000400 +#define VK_SUBGROUP_FEATURE_ROTATE_BIT_KHR VK_SUBGROUP_FEATURE_ROTATE_BIT +#define VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT_KHR VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT +typedef struct VkPhysicalDeviceShaderSubgroupRotateFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderSubgroupRotate; + VkBool32 shaderSubgroupRotateClustered; +} VkPhysicalDeviceShaderSubgroupRotateFeatures; +typedef VkPhysicalDeviceShaderSubgroupRotateFeatures VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR; +#endif // VK_KHR_shader_subgroup_rotate + +#ifndef VK_EXT_shader_atomic_float +#define VK_EXT_shader_atomic_float 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT (VkStructureType)1000260000 +typedef struct VkPhysicalDeviceShaderAtomicFloatFeaturesEXT +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderBufferFloat32Atomics; + VkBool32 shaderBufferFloat32AtomicAdd; + VkBool32 shaderBufferFloat64Atomics; + VkBool32 shaderBufferFloat64AtomicAdd; + VkBool32 shaderSharedFloat32Atomics; + VkBool32 shaderSharedFloat32AtomicAdd; + VkBool32 shaderSharedFloat64Atomics; + VkBool32 shaderSharedFloat64AtomicAdd; + VkBool32 shaderImageFloat32Atomics; + VkBool32 shaderImageFloat32AtomicAdd; + VkBool32 sparseImageFloat32Atomics; + VkBool32 sparseImageFloat32AtomicAdd; +} VkPhysicalDeviceShaderAtomicFloatFeaturesEXT; +#endif // VK_EXT_shader_atomic_float + +#ifndef VK_EXT_shader_atomic_float2 +#define VK_EXT_shader_atomic_float2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT (VkStructureType)1000273000 +typedef struct VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderBufferFloat16Atomics; + VkBool32 shaderBufferFloat16AtomicAdd; + VkBool32 shaderBufferFloat16AtomicMinMax; + VkBool32 shaderBufferFloat32AtomicMinMax; + VkBool32 shaderBufferFloat64AtomicMinMax; + VkBool32 shaderSharedFloat16Atomics; + VkBool32 shaderSharedFloat16AtomicAdd; + VkBool32 shaderSharedFloat16AtomicMinMax; + VkBool32 shaderSharedFloat32AtomicMinMax; + VkBool32 shaderSharedFloat64AtomicMinMax; + VkBool32 shaderImageFloat32AtomicMinMax; + VkBool32 sparseImageFloat32AtomicMinMax; +} VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT; +#endif // VK_EXT_shader_atomic_float2 + +#ifndef VK_KHR_shader_integer_dot_product +#define VK_KHR_shader_integer_dot_product 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES (VkStructureType)1000280000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES (VkStructureType)1000280001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES +typedef struct VkPhysicalDeviceShaderIntegerDotProductFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderIntegerDotProduct; +} VkPhysicalDeviceShaderIntegerDotProductFeatures; +typedef struct VkPhysicalDeviceShaderIntegerDotProductProperties +{ + VkStructureType sType; + void* pNext; + VkBool32 integerDotProduct8BitUnsignedAccelerated; + VkBool32 integerDotProduct8BitSignedAccelerated; + VkBool32 integerDotProduct8BitMixedSignednessAccelerated; + VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated; + VkBool32 integerDotProduct4x8BitPackedSignedAccelerated; + VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated; + VkBool32 integerDotProduct16BitUnsignedAccelerated; + VkBool32 integerDotProduct16BitSignedAccelerated; + VkBool32 integerDotProduct16BitMixedSignednessAccelerated; + VkBool32 integerDotProduct32BitUnsignedAccelerated; + VkBool32 integerDotProduct32BitSignedAccelerated; + VkBool32 integerDotProduct32BitMixedSignednessAccelerated; + VkBool32 integerDotProduct64BitUnsignedAccelerated; + VkBool32 integerDotProduct64BitSignedAccelerated; + VkBool32 integerDotProduct64BitMixedSignednessAccelerated; + VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; + VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; + VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; + VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; +} VkPhysicalDeviceShaderIntegerDotProductProperties; +typedef VkPhysicalDeviceShaderIntegerDotProductFeatures VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR; +typedef VkPhysicalDeviceShaderIntegerDotProductProperties VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR; +#endif // VK_KHR_shader_integer_dot_product + +#ifndef VK_KHR_robustness2 +#define VK_KHR_robustness2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_KHR (VkStructureType)1000286000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_KHR (VkStructureType)1000286001 +typedef struct VkPhysicalDeviceRobustness2FeaturesKHR +{ + VkStructureType sType; + void* pNext; + VkBool32 robustBufferAccess2; + VkBool32 robustImageAccess2; + VkBool32 nullDescriptor; +} VkPhysicalDeviceRobustness2FeaturesKHR; +typedef struct VkPhysicalDeviceRobustness2PropertiesKHR +{ + VkStructureType sType; + void* pNext; + VkDeviceSize robustStorageBufferAccessSizeAlignment; + VkDeviceSize robustUniformBufferAccessSizeAlignment; +} VkPhysicalDeviceRobustness2PropertiesKHR; +#endif // VK_KHR_robustness2 + +#ifndef VK_EXT_robustness2 +#define VK_EXT_robustness2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_KHR +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_KHR +typedef VkPhysicalDeviceRobustness2FeaturesKHR VkPhysicalDeviceRobustness2FeaturesEXT; +typedef VkPhysicalDeviceRobustness2PropertiesKHR VkPhysicalDeviceRobustness2PropertiesEXT; +#endif // VK_EXT_robustness2 + +#ifndef VK_KHR_shader_bfloat16 +#define VK_KHR_shader_bfloat16 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_BFLOAT16_FEATURES_KHR (VkStructureType)1000141000 +#define VK_COMPONENT_TYPE_BFLOAT16_KHR (VkComponentTypeKHR)1000141000 +typedef struct VkPhysicalDeviceShaderBfloat16FeaturesKHR +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderBFloat16Type; + VkBool32 shaderBFloat16DotProduct; + VkBool32 shaderBFloat16CooperativeMatrix; +} VkPhysicalDeviceShaderBfloat16FeaturesKHR; +#endif // VK_KHR_shader_bfloat16 + +#ifndef VK_KHR_shader_float_controls +#define VK_KHR_shader_float_controls 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES (VkStructureType)1000197000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES +typedef enum VkShaderFloatControlsIndependence +{ + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY = 0, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL = 1, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE = 2, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_MAX_ENUM = 0x7FFFFFFF +} VkShaderFloatControlsIndependence; +typedef struct VkPhysicalDeviceFloatControlsProperties +{ + VkStructureType sType; + void* pNext; + VkShaderFloatControlsIndependence denormBehaviorIndependence; + VkShaderFloatControlsIndependence roundingModeIndependence; + VkBool32 shaderSignedZeroInfNanPreserveFloat16; + VkBool32 shaderSignedZeroInfNanPreserveFloat32; + VkBool32 shaderSignedZeroInfNanPreserveFloat64; + VkBool32 shaderDenormPreserveFloat16; + VkBool32 shaderDenormPreserveFloat32; + VkBool32 shaderDenormPreserveFloat64; + VkBool32 shaderDenormFlushToZeroFloat16; + VkBool32 shaderDenormFlushToZeroFloat32; + VkBool32 shaderDenormFlushToZeroFloat64; + VkBool32 shaderRoundingModeRTEFloat16; + VkBool32 shaderRoundingModeRTEFloat32; + VkBool32 shaderRoundingModeRTEFloat64; + VkBool32 shaderRoundingModeRTZFloat16; + VkBool32 shaderRoundingModeRTZFloat32; + VkBool32 shaderRoundingModeRTZFloat64; +} VkPhysicalDeviceFloatControlsProperties; +typedef VkShaderFloatControlsIndependence VkShaderFloatControlsIndependenceKHR; +typedef VkPhysicalDeviceFloatControlsProperties VkPhysicalDeviceFloatControlsPropertiesKHR; +#endif // VK_KHR_shader_float_controls + +#ifndef VK_KHR_shader_float_controls2 +#define VK_KHR_shader_float_controls2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES (VkStructureType)1000528000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES +typedef struct VkPhysicalDeviceShaderFloatControls2Features +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderFloatControls2; +} VkPhysicalDeviceShaderFloatControls2Features; +typedef VkPhysicalDeviceShaderFloatControls2Features VkPhysicalDeviceShaderFloatControls2FeaturesKHR; +#endif // VK_KHR_shader_float_controls2 + +#ifndef VK_NV_cooperative_vector +#define VK_NV_cooperative_vector 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_VECTOR_FEATURES_NV (VkStructureType)1000491000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_VECTOR_PROPERTIES_NV (VkStructureType)1000491001 +#define VK_STRUCTURE_TYPE_COOPERATIVE_VECTOR_PROPERTIES_NV (VkStructureType)1000491002 +#define VK_STRUCTURE_TYPE_CONVERT_COOPERATIVE_VECTOR_MATRIX_INFO_NV (VkStructureType)1000491004 +#define VK_COMPONENT_TYPE_SINT8_PACKED_NV (VkComponentTypeKHR)1000491000 +#define VK_COMPONENT_TYPE_UINT8_PACKED_NV (VkComponentTypeKHR)1000491001 +#define VK_COMPONENT_TYPE_FLOAT_E4M3_NV (VkComponentTypeKHR)1000491002 +#define VK_COMPONENT_TYPE_FLOAT_E5M2_NV (VkComponentTypeKHR)1000491003 +typedef enum VkCooperativeVectorMatrixLayoutNV +{ + VK_COOPERATIVE_VECTOR_MATRIX_LAYOUT_ROW_MAJOR_NV = 0, + VK_COOPERATIVE_VECTOR_MATRIX_LAYOUT_COLUMN_MAJOR_NV = 1, + VK_COOPERATIVE_VECTOR_MATRIX_LAYOUT_INFERENCING_OPTIMAL_NV = 2, + VK_COOPERATIVE_VECTOR_MATRIX_LAYOUT_TRAINING_OPTIMAL_NV = 3, + VK_COOPERATIVE_VECTOR_MATRIX_LAYOUT_MAX_ENUM_NV = 0x7FFFFFFF +} VkCooperativeVectorMatrixLayoutNV; +#ifndef VK_KHR_acceleration_structure +typedef union VkDeviceOrHostAddressConstKHR +{ + VkDeviceAddress deviceAddress; + const void* hostAddress; +} VkDeviceOrHostAddressConstKHR; +typedef union VkDeviceOrHostAddressKHR +{ + VkDeviceAddress deviceAddress; + void* hostAddress; +} VkDeviceOrHostAddressKHR; +#endif // VK_KHR_acceleration_structure +typedef struct VkPhysicalDeviceCooperativeVectorPropertiesNV +{ + VkStructureType sType; + void* pNext; + VkShaderStageFlags cooperativeVectorSupportedStages; + VkBool32 cooperativeVectorTrainingFloat16Accumulation; + VkBool32 cooperativeVectorTrainingFloat32Accumulation; + uint32_t maxCooperativeVectorComponents; +} VkPhysicalDeviceCooperativeVectorPropertiesNV; +typedef struct VkPhysicalDeviceCooperativeVectorFeaturesNV +{ + VkStructureType sType; + void* pNext; + VkBool32 cooperativeVector; + VkBool32 cooperativeVectorTraining; +} VkPhysicalDeviceCooperativeVectorFeaturesNV; +typedef struct VkCooperativeVectorPropertiesNV +{ + VkStructureType sType; + void* pNext; + VkComponentTypeKHR inputType; + VkComponentTypeKHR inputInterpretation; + VkComponentTypeKHR matrixInterpretation; + VkComponentTypeKHR biasInterpretation; + VkComponentTypeKHR resultType; + VkBool32 transpose; +} VkCooperativeVectorPropertiesNV; +typedef struct VkConvertCooperativeVectorMatrixInfoNV +{ + VkStructureType sType; + const void* pNext; + size_t srcSize; + VkDeviceOrHostAddressConstKHR srcData; + size_t* pDstSize; + VkDeviceOrHostAddressKHR dstData; + VkComponentTypeKHR srcComponentType; + VkComponentTypeKHR dstComponentType; + uint32_t numRows; + uint32_t numColumns; + VkCooperativeVectorMatrixLayoutNV srcLayout; + size_t srcStride; + VkCooperativeVectorMatrixLayoutNV dstLayout; + size_t dstStride; +} VkConvertCooperativeVectorMatrixInfoNV; +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceCooperativeVectorPropertiesNV)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeVectorPropertiesNV* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkConvertCooperativeVectorMatrixNV)(VkDevice device, const VkConvertCooperativeVectorMatrixInfoNV* pInfo); +typedef void(VKAPI_PTR* PFN_vkCmdConvertCooperativeVectorMatrixNV)(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkConvertCooperativeVectorMatrixInfoNV* pInfos); +#endif // VK_NV_cooperative_vector + +#ifndef VK_NV_cooperative_matrix2 +#define VK_NV_cooperative_matrix2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV (VkStructureType)1000593000 +#define VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_FLEXIBLE_DIMENSIONS_PROPERTIES_NV (VkStructureType)1000593001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV (VkStructureType)1000593002 +typedef struct VkCooperativeMatrixFlexibleDimensionsPropertiesNV +{ + VkStructureType sType; + void* pNext; + uint32_t MGranularity; + uint32_t NGranularity; + uint32_t KGranularity; + VkComponentTypeKHR AType; + VkComponentTypeKHR BType; + VkComponentTypeKHR CType; + VkComponentTypeKHR ResultType; + VkBool32 saturatingAccumulation; + VkScopeKHR scope; + uint32_t workgroupInvocations; +} VkCooperativeMatrixFlexibleDimensionsPropertiesNV; +typedef struct VkPhysicalDeviceCooperativeMatrix2FeaturesNV +{ + VkStructureType sType; + void* pNext; + VkBool32 cooperativeMatrixWorkgroupScope; + VkBool32 cooperativeMatrixFlexibleDimensions; + VkBool32 cooperativeMatrixReductions; + VkBool32 cooperativeMatrixConversions; + VkBool32 cooperativeMatrixPerElementOperations; + VkBool32 cooperativeMatrixTensorAddressing; + VkBool32 cooperativeMatrixBlockLoads; +} VkPhysicalDeviceCooperativeMatrix2FeaturesNV; +typedef struct VkPhysicalDeviceCooperativeMatrix2PropertiesNV +{ + VkStructureType sType; + void* pNext; + uint32_t cooperativeMatrixWorkgroupScopeMaxWorkgroupSize; + uint32_t cooperativeMatrixFlexibleDimensionsMaxDimension; + uint32_t cooperativeMatrixWorkgroupScopeReservedSharedMemory; +} VkPhysicalDeviceCooperativeMatrix2PropertiesNV; +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixFlexibleDimensionsPropertiesNV* pProperties); +#endif // VK_NV_cooperative_matrix2 + +#ifndef VK_EXT_shader_float8 +#define VK_EXT_shader_float8 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT8_FEATURES_EXT (VkStructureType)1000567000 +#define VK_COMPONENT_TYPE_FLOAT8_E4M3_EXT (VkComponentTypeKHR)1000491002 +#define VK_COMPONENT_TYPE_FLOAT8_E5M2_EXT (VkComponentTypeKHR)1000491003 +typedef struct VkPhysicalDeviceShaderFloat8FeaturesEXT +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderFloat8; + VkBool32 shaderFloat8CooperativeMatrix; +} VkPhysicalDeviceShaderFloat8FeaturesEXT; +#endif // VK_EXT_shader_float8 + +#ifndef VK_KHR_vulkan_memory_model +#define VK_KHR_vulkan_memory_model 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES (VkStructureType)1000211000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES +typedef struct VkPhysicalDeviceVulkanMemoryModelFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 vulkanMemoryModel; + VkBool32 vulkanMemoryModelDeviceScope; + VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; +} VkPhysicalDeviceVulkanMemoryModelFeatures; +typedef VkPhysicalDeviceVulkanMemoryModelFeatures VkPhysicalDeviceVulkanMemoryModelFeaturesKHR; +#endif // VK_KHR_vulkan_memory_model + +#ifndef VK_EXT_external_memory_host +#define VK_EXT_external_memory_host 1 +#define VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT (VkStructureType)1000178000 +#define VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT (VkStructureType)1000178001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT (VkStructureType)1000178002 +typedef struct VkImportMemoryHostPointerInfoEXT +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; + void* pHostPointer; +} VkImportMemoryHostPointerInfoEXT; +typedef struct VkMemoryHostPointerPropertiesEXT +{ + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryHostPointerPropertiesEXT; +typedef struct VkPhysicalDeviceExternalMemoryHostPropertiesEXT +{ + VkStructureType sType; + void* pNext; + VkDeviceSize minImportedHostPointerAlignment; +} VkPhysicalDeviceExternalMemoryHostPropertiesEXT; +typedef VkResult(VKAPI_PTR* PFN_vkGetMemoryHostPointerPropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); +#endif // VK_EXT_external_memory_host + +#endif // NCNN_VULKAN_HEADER_FIX_H diff --git a/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-config-version.cmake b/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-config-version.cmake new file mode 100644 index 0000000..7dbe3b8 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-config-version.cmake @@ -0,0 +1,65 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, +# but only if the requested major version is the same as the current one. +# The variable CVF_VERSION must be set before calling configure_file(). + + +set(PACKAGE_VERSION "16.1.0") + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + + if("16.1.0" MATCHES "^([0-9]+)\\.") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) + string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") + endif() + else() + set(CVF_VERSION_MAJOR "16.1.0") + endif() + + if(PACKAGE_FIND_VERSION_RANGE) + # both endpoints of the range must have the expected major version + math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1") + if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR + AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + else() + if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-config.cmake b/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-config.cmake new file mode 100644 index 0000000..57609a6 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-config.cmake @@ -0,0 +1,34 @@ + +####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### +####### Any changes to this file will be overwritten by the next CMake run #### +####### The input file was glslang-config.cmake.in ######## + +get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) + +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +#################################################################################### + include(CMakeFindDependencyMacro) + if(OFF) + find_dependency(SPIRV-Tools-opt) + endif() + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_dependency(Threads) + + include("${PACKAGE_PREFIX_DIR}/lib/cmake/glslang/glslang-targets.cmake") + diff --git a/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-targets-release.cmake b/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-targets-release.cmake new file mode 100644 index 0000000..6eac5b4 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-targets-release.cmake @@ -0,0 +1,69 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Release". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "glslang::SPIRV" for configuration "Release" +set_property(TARGET glslang::SPIRV APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::SPIRV PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libSPIRV.a" + ) + +list(APPEND _cmake_import_check_targets glslang::SPIRV ) +list(APPEND _cmake_import_check_files_for_glslang::SPIRV "${_IMPORT_PREFIX}/lib/libSPIRV.a" ) + +# Import target "glslang::OSDependent" for configuration "Release" +set_property(TARGET glslang::OSDependent APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::OSDependent PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOSDependent.a" + ) + +list(APPEND _cmake_import_check_targets glslang::OSDependent ) +list(APPEND _cmake_import_check_files_for_glslang::OSDependent "${_IMPORT_PREFIX}/lib/libOSDependent.a" ) + +# Import target "glslang::glslang" for configuration "Release" +set_property(TARGET glslang::glslang APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::glslang PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libglslang.a" + ) + +list(APPEND _cmake_import_check_targets glslang::glslang ) +list(APPEND _cmake_import_check_files_for_glslang::glslang "${_IMPORT_PREFIX}/lib/libglslang.a" ) + +# Import target "glslang::MachineIndependent" for configuration "Release" +set_property(TARGET glslang::MachineIndependent APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::MachineIndependent PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libMachineIndependent.a" + ) + +list(APPEND _cmake_import_check_targets glslang::MachineIndependent ) +list(APPEND _cmake_import_check_files_for_glslang::MachineIndependent "${_IMPORT_PREFIX}/lib/libMachineIndependent.a" ) + +# Import target "glslang::GenericCodeGen" for configuration "Release" +set_property(TARGET glslang::GenericCodeGen APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::GenericCodeGen PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libGenericCodeGen.a" + ) + +list(APPEND _cmake_import_check_targets glslang::GenericCodeGen ) +list(APPEND _cmake_import_check_files_for_glslang::GenericCodeGen "${_IMPORT_PREFIX}/lib/libGenericCodeGen.a" ) + +# Import target "glslang::glslang-default-resource-limits" for configuration "Release" +set_property(TARGET glslang::glslang-default-resource-limits APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::glslang-default-resource-limits PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libglslang-default-resource-limits.a" + ) + +list(APPEND _cmake_import_check_targets glslang::glslang-default-resource-limits ) +list(APPEND _cmake_import_check_files_for_glslang::glslang-default-resource-limits "${_IMPORT_PREFIX}/lib/libglslang-default-resource-limits.a" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-targets.cmake b/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-targets.cmake new file mode 100644 index 0000000..31bc95c --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/lib/cmake/glslang/glslang-targets.cmake @@ -0,0 +1,135 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.12 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.12") + message(FATAL_ERROR "CMake >= 2.8.12 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.12...3.29) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS glslang::SPIRV glslang::OSDependent glslang::glslang glslang::MachineIndependent glslang::GenericCodeGen glslang::glslang-default-resource-limits) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target glslang::SPIRV +add_library(glslang::SPIRV STATIC IMPORTED) + +set_target_properties(glslang::SPIRV PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "glslang::glslang" +) + +# Create imported target glslang::OSDependent +add_library(glslang::OSDependent STATIC IMPORTED) + +# Create imported target glslang::glslang +add_library(glslang::glslang STATIC IMPORTED) + +set_target_properties(glslang::glslang PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "Threads::Threads" +) + +# Create imported target glslang::MachineIndependent +add_library(glslang::MachineIndependent STATIC IMPORTED) + +set_target_properties(glslang::MachineIndependent PROPERTIES + INTERFACE_LINK_LIBRARIES "glslang::glslang" +) + +# Create imported target glslang::GenericCodeGen +add_library(glslang::GenericCodeGen STATIC IMPORTED) + +# Create imported target glslang::glslang-default-resource-limits +add_library(glslang::glslang-default-resource-limits STATIC IMPORTED) + +set_target_properties(glslang::glslang-default-resource-limits PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/glslang-targets-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + if(CMAKE_VERSION VERSION_LESS "3.28" + OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} + OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + endif() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnn-release.cmake b/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnn-release.cmake new file mode 100644 index 0000000..37f24ba --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnn-release.cmake @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Release". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "ncnn" for configuration "Release" +set_property(TARGET ncnn APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(ncnn PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libncnn.a" + ) + +list(APPEND _cmake_import_check_targets ncnn ) +list(APPEND _cmake_import_check_files_for_ncnn "${_IMPORT_PREFIX}/lib/libncnn.a" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnn.cmake b/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnn.cmake new file mode 100644 index 0000000..004bc9d --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnn.cmake @@ -0,0 +1,125 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.12 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.12") + message(FATAL_ERROR "CMake >= 2.8.12 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.12...3.29) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS ncnn) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target ncnn +add_library(ncnn STATIC IMPORTED) + +set_target_properties(ncnn PROPERTIES + INTERFACE_COMPILE_OPTIONS "-fno-rtti;-fno-exceptions" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/ncnn" + INTERFACE_LINK_LIBRARIES "-fopenmp;-static-openmp;Threads::Threads;\$;\$;\$;android;jnigraphics;log" + INTERFACE_POSITION_INDEPENDENT_CODE "ON" +) + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/ncnn-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + if(CMAKE_VERSION VERSION_LESS "3.28" + OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} + OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + endif() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# Make sure the targets which have been exported in some other +# export set exist. +unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets) +foreach(_target "glslang::glslang" "glslang::SPIRV" ) + if(NOT TARGET "${_target}" ) + set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets "${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets} ${_target}") + endif() +endforeach() + +if(DEFINED ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets) + if(CMAKE_FIND_PACKAGE_NAME) + set( ${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE) + set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "The following imported targets are referenced, but are missing: ${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}") + else() + message(FATAL_ERROR "The following imported targets are referenced, but are missing: ${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}") + endif() +endif() +unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnnConfig.cmake b/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnnConfig.cmake new file mode 100644 index 0000000..0e425b6 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnnConfig.cmake @@ -0,0 +1,54 @@ +set(NCNN_VERSION 20260526) +set(NCNN_OPENMP ON) +set(NCNN_THREADS ON) +set(NCNN_VULKAN ON) +set(NCNN_SHARED_LIB OFF) +set(NCNN_SYSTEM_GLSLANG OFF) +set(NCNN_SIMPLEVK ON) + +if(NCNN_OPENMP) + find_package(OpenMP) +endif() + +if(NCNN_THREADS) + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_package(Threads REQUIRED) +endif() + +if(NCNN_VULKAN) + if(NOT NCNN_SIMPLEVK) + find_package(Vulkan REQUIRED) + endif() + + if(NOT NCNN_SHARED_LIB) + if(NCNN_SYSTEM_GLSLANG) + find_package(SPIRV-Tools QUIET) + find_package(SPIRV-Tools-opt QUIET) + find_package(glslang QUIET) + if(NOT glslang_FOUND) + set(GLSLANG_TARGET_DIR "") + include(${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake) + include(${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake) + if(EXISTS "${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") + # hlsl support can be optional + include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") + endif() + include(${GLSLANG_TARGET_DIR}/glslangTargets.cmake) + include(${GLSLANG_TARGET_DIR}/SPIRVTargets.cmake) + endif() + else() + set(glslang_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../lib/cmake/glslang") + find_package(glslang QUIET) + endif() + endif() +endif() + +include(${CMAKE_CURRENT_LIST_DIR}/ncnn.cmake) + +if(TARGET ncnn) + set(ncnn_FOUND TRUE) + if(NOT ncnn_FIND_QUIETLY) + message(STATUS "Found ncnn: ${NCNN_VERSION}") + endif() +endif() diff --git a/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnnConfigVersion.cmake b/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnnConfigVersion.cmake new file mode 100644 index 0000000..2da4047 --- /dev/null +++ b/app/libs/ncnn/arm64-v8a/lib/cmake/ncnn/ncnnConfigVersion.cmake @@ -0,0 +1,43 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. +# The variable CVF_VERSION must be set before calling configure_file(). + +set(PACKAGE_VERSION "20260526") + +if (PACKAGE_FIND_VERSION_RANGE) + # Package version must be in the requested version range + if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN) + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + endif() +else() + if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/app/libs/ncnn/arm64-v8a/lib/libGenericCodeGen.a b/app/libs/ncnn/arm64-v8a/lib/libGenericCodeGen.a new file mode 100644 index 0000000..1702628 Binary files /dev/null and b/app/libs/ncnn/arm64-v8a/lib/libGenericCodeGen.a differ diff --git a/app/libs/ncnn/arm64-v8a/lib/libMachineIndependent.a b/app/libs/ncnn/arm64-v8a/lib/libMachineIndependent.a new file mode 100644 index 0000000..1702628 Binary files /dev/null and b/app/libs/ncnn/arm64-v8a/lib/libMachineIndependent.a differ diff --git a/app/libs/ncnn/arm64-v8a/lib/libOSDependent.a b/app/libs/ncnn/arm64-v8a/lib/libOSDependent.a new file mode 100644 index 0000000..1702628 Binary files /dev/null and b/app/libs/ncnn/arm64-v8a/lib/libOSDependent.a differ diff --git a/app/libs/ncnn/arm64-v8a/lib/libSPIRV.a b/app/libs/ncnn/arm64-v8a/lib/libSPIRV.a new file mode 100644 index 0000000..1702628 Binary files /dev/null and b/app/libs/ncnn/arm64-v8a/lib/libSPIRV.a differ diff --git a/app/libs/ncnn/arm64-v8a/lib/libglslang-default-resource-limits.a b/app/libs/ncnn/arm64-v8a/lib/libglslang-default-resource-limits.a new file mode 100644 index 0000000..ad4e216 Binary files /dev/null and b/app/libs/ncnn/arm64-v8a/lib/libglslang-default-resource-limits.a differ diff --git a/app/libs/ncnn/arm64-v8a/lib/libglslang.a b/app/libs/ncnn/arm64-v8a/lib/libglslang.a new file mode 100644 index 0000000..687fe40 Binary files /dev/null and b/app/libs/ncnn/arm64-v8a/lib/libglslang.a differ diff --git a/app/libs/ncnn/arm64-v8a/lib/libncnn.a b/app/libs/ncnn/arm64-v8a/lib/libncnn.a new file mode 100644 index 0000000..c4e3436 Binary files /dev/null and b/app/libs/ncnn/arm64-v8a/lib/libncnn.a differ diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/Include/ResourceLimits.h b/app/libs/ncnn/armeabi-v7a/include/glslang/Include/ResourceLimits.h new file mode 100644 index 0000000..b36c8d6 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/Include/ResourceLimits.h @@ -0,0 +1,159 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. +// + +#ifndef _RESOURCE_LIMITS_INCLUDED_ +#define _RESOURCE_LIMITS_INCLUDED_ + +struct TLimits { + bool nonInductiveForLoops; + bool whileLoops; + bool doWhileLoops; + bool generalUniformIndexing; + bool generalAttributeMatrixVectorIndexing; + bool generalVaryingIndexing; + bool generalSamplerIndexing; + bool generalVariableIndexing; + bool generalConstantMatrixVectorIndexing; +}; + +struct TBuiltInResource { + int maxLights; + int maxClipPlanes; + int maxTextureUnits; + int maxTextureCoords; + int maxVertexAttribs; + int maxVertexUniformComponents; + int maxVaryingFloats; + int maxVertexTextureImageUnits; + int maxCombinedTextureImageUnits; + int maxTextureImageUnits; + int maxFragmentUniformComponents; + int maxDrawBuffers; + int maxVertexUniformVectors; + int maxVaryingVectors; + int maxFragmentUniformVectors; + int maxVertexOutputVectors; + int maxFragmentInputVectors; + int minProgramTexelOffset; + int maxProgramTexelOffset; + int maxClipDistances; + int maxComputeWorkGroupCountX; + int maxComputeWorkGroupCountY; + int maxComputeWorkGroupCountZ; + int maxComputeWorkGroupSizeX; + int maxComputeWorkGroupSizeY; + int maxComputeWorkGroupSizeZ; + int maxComputeUniformComponents; + int maxComputeTextureImageUnits; + int maxComputeImageUniforms; + int maxComputeAtomicCounters; + int maxComputeAtomicCounterBuffers; + int maxVaryingComponents; + int maxVertexOutputComponents; + int maxGeometryInputComponents; + int maxGeometryOutputComponents; + int maxFragmentInputComponents; + int maxImageUnits; + int maxCombinedImageUnitsAndFragmentOutputs; + int maxCombinedShaderOutputResources; + int maxImageSamples; + int maxVertexImageUniforms; + int maxTessControlImageUniforms; + int maxTessEvaluationImageUniforms; + int maxGeometryImageUniforms; + int maxFragmentImageUniforms; + int maxCombinedImageUniforms; + int maxGeometryTextureImageUnits; + int maxGeometryOutputVertices; + int maxGeometryTotalOutputComponents; + int maxGeometryUniformComponents; + int maxGeometryVaryingComponents; + int maxTessControlInputComponents; + int maxTessControlOutputComponents; + int maxTessControlTextureImageUnits; + int maxTessControlUniformComponents; + int maxTessControlTotalOutputComponents; + int maxTessEvaluationInputComponents; + int maxTessEvaluationOutputComponents; + int maxTessEvaluationTextureImageUnits; + int maxTessEvaluationUniformComponents; + int maxTessPatchComponents; + int maxPatchVertices; + int maxTessGenLevel; + int maxViewports; + int maxVertexAtomicCounters; + int maxTessControlAtomicCounters; + int maxTessEvaluationAtomicCounters; + int maxGeometryAtomicCounters; + int maxFragmentAtomicCounters; + int maxCombinedAtomicCounters; + int maxAtomicCounterBindings; + int maxVertexAtomicCounterBuffers; + int maxTessControlAtomicCounterBuffers; + int maxTessEvaluationAtomicCounterBuffers; + int maxGeometryAtomicCounterBuffers; + int maxFragmentAtomicCounterBuffers; + int maxCombinedAtomicCounterBuffers; + int maxAtomicCounterBufferSize; + int maxTransformFeedbackBuffers; + int maxTransformFeedbackInterleavedComponents; + int maxCullDistances; + int maxCombinedClipAndCullDistances; + int maxSamples; + int maxMeshOutputVerticesNV; + int maxMeshOutputPrimitivesNV; + int maxMeshWorkGroupSizeX_NV; + int maxMeshWorkGroupSizeY_NV; + int maxMeshWorkGroupSizeZ_NV; + int maxTaskWorkGroupSizeX_NV; + int maxTaskWorkGroupSizeY_NV; + int maxTaskWorkGroupSizeZ_NV; + int maxMeshViewCountNV; + int maxMeshOutputVerticesEXT; + int maxMeshOutputPrimitivesEXT; + int maxMeshWorkGroupSizeX_EXT; + int maxMeshWorkGroupSizeY_EXT; + int maxMeshWorkGroupSizeZ_EXT; + int maxTaskWorkGroupSizeX_EXT; + int maxTaskWorkGroupSizeY_EXT; + int maxTaskWorkGroupSizeZ_EXT; + int maxMeshViewCountEXT; + int maxDualSourceDrawBuffersEXT; + + TLimits limits; +}; + +#endif // _RESOURCE_LIMITS_INCLUDED_ diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/Include/glslang_c_interface.h b/app/libs/ncnn/armeabi-v7a/include/glslang/Include/glslang_c_interface.h new file mode 100644 index 0000000..4eec55b --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/Include/glslang_c_interface.h @@ -0,0 +1,299 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +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. +**/ + +#ifndef GLSLANG_C_IFACE_H_INCLUDED +#define GLSLANG_C_IFACE_H_INCLUDED + +#include +#include + +#include "glslang_c_shader_types.h" +#include "visibility.h" + +typedef struct glslang_shader_s glslang_shader_t; +typedef struct glslang_program_s glslang_program_t; +typedef struct glslang_mapper_s glslang_mapper_t; +typedef struct glslang_resolver_s glslang_resolver_t; + +/* Version counterpart */ +typedef struct glslang_version_s { + int major; + int minor; + int patch; + const char* flavor; +} glslang_version_t; + +/* TLimits counterpart */ +typedef struct glslang_limits_s { + bool non_inductive_for_loops; + bool while_loops; + bool do_while_loops; + bool general_uniform_indexing; + bool general_attribute_matrix_vector_indexing; + bool general_varying_indexing; + bool general_sampler_indexing; + bool general_variable_indexing; + bool general_constant_matrix_vector_indexing; +} glslang_limits_t; + +/* TBuiltInResource counterpart */ +typedef struct glslang_resource_s { + int max_lights; + int max_clip_planes; + int max_texture_units; + int max_texture_coords; + int max_vertex_attribs; + int max_vertex_uniform_components; + int max_varying_floats; + int max_vertex_texture_image_units; + int max_combined_texture_image_units; + int max_texture_image_units; + int max_fragment_uniform_components; + int max_draw_buffers; + int max_vertex_uniform_vectors; + int max_varying_vectors; + int max_fragment_uniform_vectors; + int max_vertex_output_vectors; + int max_fragment_input_vectors; + int min_program_texel_offset; + int max_program_texel_offset; + int max_clip_distances; + int max_compute_work_group_count_x; + int max_compute_work_group_count_y; + int max_compute_work_group_count_z; + int max_compute_work_group_size_x; + int max_compute_work_group_size_y; + int max_compute_work_group_size_z; + int max_compute_uniform_components; + int max_compute_texture_image_units; + int max_compute_image_uniforms; + int max_compute_atomic_counters; + int max_compute_atomic_counter_buffers; + int max_varying_components; + int max_vertex_output_components; + int max_geometry_input_components; + int max_geometry_output_components; + int max_fragment_input_components; + int max_image_units; + int max_combined_image_units_and_fragment_outputs; + int max_combined_shader_output_resources; + int max_image_samples; + int max_vertex_image_uniforms; + int max_tess_control_image_uniforms; + int max_tess_evaluation_image_uniforms; + int max_geometry_image_uniforms; + int max_fragment_image_uniforms; + int max_combined_image_uniforms; + int max_geometry_texture_image_units; + int max_geometry_output_vertices; + int max_geometry_total_output_components; + int max_geometry_uniform_components; + int max_geometry_varying_components; + int max_tess_control_input_components; + int max_tess_control_output_components; + int max_tess_control_texture_image_units; + int max_tess_control_uniform_components; + int max_tess_control_total_output_components; + int max_tess_evaluation_input_components; + int max_tess_evaluation_output_components; + int max_tess_evaluation_texture_image_units; + int max_tess_evaluation_uniform_components; + int max_tess_patch_components; + int max_patch_vertices; + int max_tess_gen_level; + int max_viewports; + int max_vertex_atomic_counters; + int max_tess_control_atomic_counters; + int max_tess_evaluation_atomic_counters; + int max_geometry_atomic_counters; + int max_fragment_atomic_counters; + int max_combined_atomic_counters; + int max_atomic_counter_bindings; + int max_vertex_atomic_counter_buffers; + int max_tess_control_atomic_counter_buffers; + int max_tess_evaluation_atomic_counter_buffers; + int max_geometry_atomic_counter_buffers; + int max_fragment_atomic_counter_buffers; + int max_combined_atomic_counter_buffers; + int max_atomic_counter_buffer_size; + int max_transform_feedback_buffers; + int max_transform_feedback_interleaved_components; + int max_cull_distances; + int max_combined_clip_and_cull_distances; + int max_samples; + int max_mesh_output_vertices_nv; + int max_mesh_output_primitives_nv; + int max_mesh_work_group_size_x_nv; + int max_mesh_work_group_size_y_nv; + int max_mesh_work_group_size_z_nv; + int max_task_work_group_size_x_nv; + int max_task_work_group_size_y_nv; + int max_task_work_group_size_z_nv; + int max_mesh_view_count_nv; + int max_mesh_output_vertices_ext; + int max_mesh_output_primitives_ext; + int max_mesh_work_group_size_x_ext; + int max_mesh_work_group_size_y_ext; + int max_mesh_work_group_size_z_ext; + int max_task_work_group_size_x_ext; + int max_task_work_group_size_y_ext; + int max_task_work_group_size_z_ext; + int max_mesh_view_count_ext; + union + { + int max_dual_source_draw_buffers_ext; + + /* Incorrectly capitalized name retained for backward compatibility */ + int maxDualSourceDrawBuffersEXT; + }; + + glslang_limits_t limits; +} glslang_resource_t; + +/* Inclusion result structure allocated by C include_local/include_system callbacks */ +typedef struct glsl_include_result_s { + /* Header file name or NULL if inclusion failed */ + const char* header_name; + + /* Header contents or NULL */ + const char* header_data; + size_t header_length; + +} glsl_include_result_t; + +/* Callback for local file inclusion */ +typedef glsl_include_result_t* (*glsl_include_local_func)(void* ctx, const char* header_name, const char* includer_name, + size_t include_depth); + +/* Callback for system file inclusion */ +typedef glsl_include_result_t* (*glsl_include_system_func)(void* ctx, const char* header_name, + const char* includer_name, size_t include_depth); + +/* Callback for include result destruction */ +typedef int (*glsl_free_include_result_func)(void* ctx, glsl_include_result_t* result); + +/* Collection of callbacks for GLSL preprocessor */ +typedef struct glsl_include_callbacks_s { + glsl_include_system_func include_system; + glsl_include_local_func include_local; + glsl_free_include_result_func free_include_result; +} glsl_include_callbacks_t; + +typedef struct glslang_input_s { + glslang_source_t language; + glslang_stage_t stage; + glslang_client_t client; + glslang_target_client_version_t client_version; + glslang_target_language_t target_language; + glslang_target_language_version_t target_language_version; + /** Shader source code */ + const char* code; + int default_version; + glslang_profile_t default_profile; + int force_default_version_and_profile; + int forward_compatible; + glslang_messages_t messages; + const glslang_resource_t* resource; + glsl_include_callbacks_t callbacks; + void* callbacks_ctx; +} glslang_input_t; + +/* SpvOptions counterpart */ +typedef struct glslang_spv_options_s { + bool generate_debug_info; + bool strip_debug_info; + bool disable_optimizer; + bool optimize_size; + bool disassemble; + bool validate; + bool emit_nonsemantic_shader_debug_info; + bool emit_nonsemantic_shader_debug_source; + bool compile_only; + bool optimize_allow_expanded_id_bound; +} glslang_spv_options_t; + +#ifdef __cplusplus +extern "C" { +#endif + +GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version); + +GLSLANG_EXPORT int glslang_initialize_process(void); +GLSLANG_EXPORT void glslang_finalize_process(void); + +GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input); +GLSLANG_EXPORT void glslang_shader_delete(glslang_shader_t* shader); +GLSLANG_EXPORT void glslang_shader_set_preamble(glslang_shader_t* shader, const char* s); +GLSLANG_EXPORT void glslang_shader_set_entry_point(glslang_shader_t* shader, const char* s); +GLSLANG_EXPORT void glslang_shader_set_invert_y(glslang_shader_t* shader, bool y); +GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base); +GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set); +GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options); // glslang_shader_options_t +GLSLANG_EXPORT void glslang_shader_set_glsl_version(glslang_shader_t* shader, int version); +GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_set_and_binding(glslang_shader_t* shader, unsigned int set, unsigned int binding); +GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_name(glslang_shader_t* shader, const char *name); +GLSLANG_EXPORT void glslang_shader_set_resource_set_binding(glslang_shader_t* shader, const char *const *bindings, unsigned int num_bindings); +GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input); +GLSLANG_EXPORT int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input); +GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader); +GLSLANG_EXPORT void glslang_shader_set_preprocessed_code(glslang_shader_t* shader, const char* code); +GLSLANG_EXPORT const char* glslang_shader_get_info_log(glslang_shader_t* shader); +GLSLANG_EXPORT const char* glslang_shader_get_info_debug_log(glslang_shader_t* shader); + +GLSLANG_EXPORT glslang_program_t* glslang_program_create(void); +GLSLANG_EXPORT void glslang_program_delete(glslang_program_t* program); +GLSLANG_EXPORT void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader); +GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages); // glslang_messages_t +GLSLANG_EXPORT void glslang_program_add_source_text(glslang_program_t* program, glslang_stage_t stage, const char* text, size_t len); +GLSLANG_EXPORT void glslang_program_set_source_file(glslang_program_t* program, glslang_stage_t stage, const char* file); +GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program); +GLSLANG_EXPORT int glslang_program_map_io_with_resolver_and_mapper(glslang_program_t* program, glslang_resolver_t* resolver, glslang_mapper_t* mapper); +GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage); +GLSLANG_EXPORT void glslang_program_SPIRV_generate_with_options(glslang_program_t* program, glslang_stage_t stage, glslang_spv_options_t* spv_options); +GLSLANG_EXPORT size_t glslang_program_SPIRV_get_size(glslang_program_t* program); +GLSLANG_EXPORT void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int*); +GLSLANG_EXPORT unsigned int* glslang_program_SPIRV_get_ptr(glslang_program_t* program); +GLSLANG_EXPORT const char* glslang_program_SPIRV_get_messages(glslang_program_t* program); +GLSLANG_EXPORT const char* glslang_program_get_info_log(glslang_program_t* program); +GLSLANG_EXPORT const char* glslang_program_get_info_debug_log(glslang_program_t* program); + +GLSLANG_EXPORT glslang_mapper_t* glslang_glsl_mapper_create(void); +GLSLANG_EXPORT void glslang_glsl_mapper_delete(glslang_mapper_t* mapper); + +GLSLANG_EXPORT glslang_resolver_t* glslang_glsl_resolver_create(glslang_program_t* program, glslang_stage_t stage); +GLSLANG_EXPORT void glslang_glsl_resolver_delete(glslang_resolver_t* resolver); + +#ifdef __cplusplus +} +#endif + +#endif /* #ifdef GLSLANG_C_IFACE_INCLUDED */ diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/Include/glslang_c_shader_types.h b/app/libs/ncnn/armeabi-v7a/include/glslang/Include/glslang_c_shader_types.h new file mode 100644 index 0000000..ccba2fd --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/Include/glslang_c_shader_types.h @@ -0,0 +1,235 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +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. +**/ + +#ifndef C_SHADER_TYPES_H_INCLUDED +#define C_SHADER_TYPES_H_INCLUDED + +#define LAST_ELEMENT_MARKER(x) x + +/* EShLanguage counterpart */ +typedef enum { + GLSLANG_STAGE_VERTEX, + GLSLANG_STAGE_TESSCONTROL, + GLSLANG_STAGE_TESSEVALUATION, + GLSLANG_STAGE_GEOMETRY, + GLSLANG_STAGE_FRAGMENT, + GLSLANG_STAGE_COMPUTE, + GLSLANG_STAGE_RAYGEN, + GLSLANG_STAGE_RAYGEN_NV = GLSLANG_STAGE_RAYGEN, + GLSLANG_STAGE_INTERSECT, + GLSLANG_STAGE_INTERSECT_NV = GLSLANG_STAGE_INTERSECT, + GLSLANG_STAGE_ANYHIT, + GLSLANG_STAGE_ANYHIT_NV = GLSLANG_STAGE_ANYHIT, + GLSLANG_STAGE_CLOSESTHIT, + GLSLANG_STAGE_CLOSESTHIT_NV = GLSLANG_STAGE_CLOSESTHIT, + GLSLANG_STAGE_MISS, + GLSLANG_STAGE_MISS_NV = GLSLANG_STAGE_MISS, + GLSLANG_STAGE_CALLABLE, + GLSLANG_STAGE_CALLABLE_NV = GLSLANG_STAGE_CALLABLE, + GLSLANG_STAGE_TASK, + GLSLANG_STAGE_TASK_NV = GLSLANG_STAGE_TASK, + GLSLANG_STAGE_MESH, + GLSLANG_STAGE_MESH_NV = GLSLANG_STAGE_MESH, + LAST_ELEMENT_MARKER(GLSLANG_STAGE_COUNT), +} glslang_stage_t; // would be better as stage, but this is ancient now + +/* EShLanguageMask counterpart */ +typedef enum { + GLSLANG_STAGE_VERTEX_MASK = (1 << GLSLANG_STAGE_VERTEX), + GLSLANG_STAGE_TESSCONTROL_MASK = (1 << GLSLANG_STAGE_TESSCONTROL), + GLSLANG_STAGE_TESSEVALUATION_MASK = (1 << GLSLANG_STAGE_TESSEVALUATION), + GLSLANG_STAGE_GEOMETRY_MASK = (1 << GLSLANG_STAGE_GEOMETRY), + GLSLANG_STAGE_FRAGMENT_MASK = (1 << GLSLANG_STAGE_FRAGMENT), + GLSLANG_STAGE_COMPUTE_MASK = (1 << GLSLANG_STAGE_COMPUTE), + GLSLANG_STAGE_RAYGEN_MASK = (1 << GLSLANG_STAGE_RAYGEN), + GLSLANG_STAGE_RAYGEN_NV_MASK = GLSLANG_STAGE_RAYGEN_MASK, + GLSLANG_STAGE_INTERSECT_MASK = (1 << GLSLANG_STAGE_INTERSECT), + GLSLANG_STAGE_INTERSECT_NV_MASK = GLSLANG_STAGE_INTERSECT_MASK, + GLSLANG_STAGE_ANYHIT_MASK = (1 << GLSLANG_STAGE_ANYHIT), + GLSLANG_STAGE_ANYHIT_NV_MASK = GLSLANG_STAGE_ANYHIT_MASK, + GLSLANG_STAGE_CLOSESTHIT_MASK = (1 << GLSLANG_STAGE_CLOSESTHIT), + GLSLANG_STAGE_CLOSESTHIT_NV_MASK = GLSLANG_STAGE_CLOSESTHIT_MASK, + GLSLANG_STAGE_MISS_MASK = (1 << GLSLANG_STAGE_MISS), + GLSLANG_STAGE_MISS_NV_MASK = GLSLANG_STAGE_MISS_MASK, + GLSLANG_STAGE_CALLABLE_MASK = (1 << GLSLANG_STAGE_CALLABLE), + GLSLANG_STAGE_CALLABLE_NV_MASK = GLSLANG_STAGE_CALLABLE_MASK, + GLSLANG_STAGE_TASK_MASK = (1 << GLSLANG_STAGE_TASK), + GLSLANG_STAGE_TASK_NV_MASK = GLSLANG_STAGE_TASK_MASK, + GLSLANG_STAGE_MESH_MASK = (1 << GLSLANG_STAGE_MESH), + GLSLANG_STAGE_MESH_NV_MASK = GLSLANG_STAGE_MESH_MASK, + LAST_ELEMENT_MARKER(GLSLANG_STAGE_MASK_COUNT), +} glslang_stage_mask_t; + +/* EShSource counterpart */ +typedef enum { + GLSLANG_SOURCE_NONE, + GLSLANG_SOURCE_GLSL, + GLSLANG_SOURCE_HLSL, + LAST_ELEMENT_MARKER(GLSLANG_SOURCE_COUNT), +} glslang_source_t; + +/* EShClient counterpart */ +typedef enum { + GLSLANG_CLIENT_NONE, + GLSLANG_CLIENT_VULKAN, + GLSLANG_CLIENT_OPENGL, + LAST_ELEMENT_MARKER(GLSLANG_CLIENT_COUNT), +} glslang_client_t; + +/* EShTargetLanguage counterpart */ +typedef enum { + GLSLANG_TARGET_NONE, + GLSLANG_TARGET_SPV, + LAST_ELEMENT_MARKER(GLSLANG_TARGET_COUNT), +} glslang_target_language_t; + +/* SH_TARGET_ClientVersion counterpart */ +typedef enum { + GLSLANG_TARGET_VULKAN_1_0 = (1 << 22), + GLSLANG_TARGET_VULKAN_1_1 = (1 << 22) | (1 << 12), + GLSLANG_TARGET_VULKAN_1_2 = (1 << 22) | (2 << 12), + GLSLANG_TARGET_VULKAN_1_3 = (1 << 22) | (3 << 12), + GLSLANG_TARGET_VULKAN_1_4 = (1 << 22) | (4 << 12), + GLSLANG_TARGET_OPENGL_450 = 450, + LAST_ELEMENT_MARKER(GLSLANG_TARGET_CLIENT_VERSION_COUNT = 6), +} glslang_target_client_version_t; + +/* SH_TARGET_LanguageVersion counterpart */ +typedef enum { + GLSLANG_TARGET_SPV_1_0 = (1 << 16), + GLSLANG_TARGET_SPV_1_1 = (1 << 16) | (1 << 8), + GLSLANG_TARGET_SPV_1_2 = (1 << 16) | (2 << 8), + GLSLANG_TARGET_SPV_1_3 = (1 << 16) | (3 << 8), + GLSLANG_TARGET_SPV_1_4 = (1 << 16) | (4 << 8), + GLSLANG_TARGET_SPV_1_5 = (1 << 16) | (5 << 8), + GLSLANG_TARGET_SPV_1_6 = (1 << 16) | (6 << 8), + LAST_ELEMENT_MARKER(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT = 7), +} glslang_target_language_version_t; + +/* EShExecutable counterpart */ +typedef enum { GLSLANG_EX_VERTEX_FRAGMENT, GLSLANG_EX_FRAGMENT } glslang_executable_t; + +// EShOptimizationLevel counterpart +// This enum is not used in the current C interface, but could be added at a later date. +// GLSLANG_OPT_NONE is the current default. +typedef enum { + GLSLANG_OPT_NO_GENERATION, + GLSLANG_OPT_NONE, + GLSLANG_OPT_SIMPLE, + GLSLANG_OPT_FULL, + LAST_ELEMENT_MARKER(GLSLANG_OPT_LEVEL_COUNT), +} glslang_optimization_level_t; + +/* EShTextureSamplerTransformMode counterpart */ +typedef enum { + GLSLANG_TEX_SAMP_TRANS_KEEP, + GLSLANG_TEX_SAMP_TRANS_UPGRADE_TEXTURE_REMOVE_SAMPLER, + LAST_ELEMENT_MARKER(GLSLANG_TEX_SAMP_TRANS_COUNT), +} glslang_texture_sampler_transform_mode_t; + +/* EShMessages counterpart */ +typedef enum { + GLSLANG_MSG_DEFAULT_BIT = 0, + GLSLANG_MSG_RELAXED_ERRORS_BIT = (1 << 0), + GLSLANG_MSG_SUPPRESS_WARNINGS_BIT = (1 << 1), + GLSLANG_MSG_AST_BIT = (1 << 2), + GLSLANG_MSG_SPV_RULES_BIT = (1 << 3), + GLSLANG_MSG_VULKAN_RULES_BIT = (1 << 4), + GLSLANG_MSG_ONLY_PREPROCESSOR_BIT = (1 << 5), + GLSLANG_MSG_READ_HLSL_BIT = (1 << 6), + GLSLANG_MSG_CASCADING_ERRORS_BIT = (1 << 7), + GLSLANG_MSG_KEEP_UNCALLED_BIT = (1 << 8), + GLSLANG_MSG_HLSL_OFFSETS_BIT = (1 << 9), + GLSLANG_MSG_DEBUG_INFO_BIT = (1 << 10), + GLSLANG_MSG_HLSL_ENABLE_16BIT_TYPES_BIT = (1 << 11), + GLSLANG_MSG_HLSL_LEGALIZATION_BIT = (1 << 12), + GLSLANG_MSG_HLSL_DX9_COMPATIBLE_BIT = (1 << 13), + GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT = (1 << 14), + GLSLANG_MSG_ENHANCED = (1 << 15), + GLSLANG_MSG_ABSOLUTE_PATH = (1 << 16), + GLSLANG_MSG_DISPLAY_ERROR_COLUMN = (1 << 17), + GLSLANG_MSG_LINK_TIME_OPTIMIZATION_BIT = (1 << 18), + GLSLANG_MSG_VALIDATE_CROSS_STAGE_IO_BIT = (1 << 19), + LAST_ELEMENT_MARKER(GLSLANG_MSG_COUNT), +} glslang_messages_t; + +/* EShReflectionOptions counterpart */ +typedef enum { + GLSLANG_REFLECTION_DEFAULT_BIT = 0, + GLSLANG_REFLECTION_STRICT_ARRAY_SUFFIX_BIT = (1 << 0), + GLSLANG_REFLECTION_BASIC_ARRAY_SUFFIX_BIT = (1 << 1), + GLSLANG_REFLECTION_INTERMEDIATE_IOO_BIT = (1 << 2), + GLSLANG_REFLECTION_SEPARATE_BUFFERS_BIT = (1 << 3), + GLSLANG_REFLECTION_ALL_BLOCK_VARIABLES_BIT = (1 << 4), + GLSLANG_REFLECTION_UNWRAP_IO_BLOCKS_BIT = (1 << 5), + GLSLANG_REFLECTION_ALL_IO_VARIABLES_BIT = (1 << 6), + GLSLANG_REFLECTION_SHARED_STD140_SSBO_BIT = (1 << 7), + GLSLANG_REFLECTION_SHARED_STD140_UBO_BIT = (1 << 8), + LAST_ELEMENT_MARKER(GLSLANG_REFLECTION_COUNT), +} glslang_reflection_options_t; + +/* EProfile counterpart (from Versions.h) */ +typedef enum { + GLSLANG_BAD_PROFILE = 0, + GLSLANG_NO_PROFILE = (1 << 0), + GLSLANG_CORE_PROFILE = (1 << 1), + GLSLANG_COMPATIBILITY_PROFILE = (1 << 2), + GLSLANG_ES_PROFILE = (1 << 3), + LAST_ELEMENT_MARKER(GLSLANG_PROFILE_COUNT), +} glslang_profile_t; + +/* Shader options */ +typedef enum { + GLSLANG_SHADER_DEFAULT_BIT = 0, + GLSLANG_SHADER_AUTO_MAP_BINDINGS = (1 << 0), + GLSLANG_SHADER_AUTO_MAP_LOCATIONS = (1 << 1), + GLSLANG_SHADER_VULKAN_RULES_RELAXED = (1 << 2), + LAST_ELEMENT_MARKER(GLSLANG_SHADER_COUNT), +} glslang_shader_options_t; + +/* TResourceType counterpart */ +typedef enum { + GLSLANG_RESOURCE_TYPE_SAMPLER, + GLSLANG_RESOURCE_TYPE_TEXTURE, + GLSLANG_RESOURCE_TYPE_IMAGE, + GLSLANG_RESOURCE_TYPE_UBO, + GLSLANG_RESOURCE_TYPE_SSBO, + GLSLANG_RESOURCE_TYPE_UAV, + GLSLANG_RESOURCE_TYPE_COMBINED_SAMPLER, + GLSLANG_RESOURCE_TYPE_AS, + GLSLANG_RESOURCE_TYPE_TENSOR, + LAST_ELEMENT_MARKER(GLSLANG_RESOURCE_TYPE_COUNT), +} glslang_resource_type_t; + +#undef LAST_ELEMENT_MARKER + +#endif diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/Include/visibility.h b/app/libs/ncnn/armeabi-v7a/include/glslang/Include/visibility.h new file mode 100644 index 0000000..dd32351 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/Include/visibility.h @@ -0,0 +1,58 @@ +// +// Copyright (C) 2023 LunarG, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. +// +#ifdef GLSLANG_IS_SHARED_LIBRARY + #ifdef _WIN32 + #ifdef GLSLANG_EXPORTING + #define GLSLANG_EXPORT __declspec(dllexport) + #else + #define GLSLANG_EXPORT __declspec(dllimport) + #endif + #elif __GNUC__ >= 4 + #define GLSLANG_EXPORT __attribute__((visibility("default"))) + #endif +#endif // GLSLANG_IS_SHARED_LIBRARY + +#ifndef GLSLANG_EXPORT +#define GLSLANG_EXPORT +#endif + +// Symbols marked with this macro are only meant for public use by the test suite +// and do not appear in publicly installed headers. They are not considered to be +// part of the glslang library ABI. +#ifdef GLSLANG_TEST_BUILD + #define GLSLANG_EXPORT_FOR_TESTS GLSLANG_EXPORT +#else + #define GLSLANG_EXPORT_FOR_TESTS +#endif diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/MachineIndependent/Versions.h b/app/libs/ncnn/armeabi-v7a/include/glslang/MachineIndependent/Versions.h new file mode 100644 index 0000000..76f4256 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/MachineIndependent/Versions.h @@ -0,0 +1,412 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2017, 2022-2024 Arm Limited. +// Copyright (C) 2015-2018 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// Modifications Copyright (C) 2024 Valve Corporation. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. +// + +#ifndef _VERSIONS_INCLUDED_ +#define _VERSIONS_INCLUDED_ + +#define LAST_ELEMENT_MARKER(x) x + +// +// Help manage multiple profiles, versions, extensions etc. +// + +// +// Profiles are set up for masking operations, so queries can be done on multiple +// profiles at the same time. +// +// Don't maintain an ordinal set of enums (0,1,2,3...) to avoid all possible +// defects from mixing the two different forms. +// +typedef enum : unsigned { + EBadProfile = 0, + ENoProfile = (1 << 0), // only for desktop, before profiles showed up + ECoreProfile = (1 << 1), + ECompatibilityProfile = (1 << 2), + EEsProfile = (1 << 3), + LAST_ELEMENT_MARKER(EProfileCount), +} EProfile; + +namespace glslang { + +// +// Map from profile enum to externally readable text name. +// +inline const char* ProfileName(EProfile profile) +{ + switch (profile) { + case ENoProfile: return "none"; + case ECoreProfile: return "core"; + case ECompatibilityProfile: return "compatibility"; + case EEsProfile: return "es"; + default: return "unknown profile"; + } +} + +// +// What source rules, validation rules, target language, etc. are needed or +// desired for SPIR-V? +// +// 0 means a target or rule set is not enabled (ignore rules from that entity). +// Non-0 means to apply semantic rules arising from that version of its rule set. +// The union of all requested rule sets will be applied. +// +struct SpvVersion { + SpvVersion() : spv(0), vulkanGlsl(0), vulkan(0), openGl(0), vulkanRelaxed(false) {} + unsigned int spv; // the version of SPIR-V to target, as defined by "word 1" of the SPIR-V binary header + int vulkanGlsl; // the version of GLSL semantics for Vulkan, from GL_KHR_vulkan_glsl, for "#define VULKAN XXX" + int vulkan; // the version of Vulkan, for which SPIR-V execution environment rules to use + int openGl; // the version of GLSL semantics for OpenGL, from GL_ARB_gl_spirv, for "#define GL_SPIRV XXX" + bool vulkanRelaxed; // relax changes to GLSL for Vulkan, allowing some GL-specific to be compiled to Vulkan SPIR-V target +}; + +// +// The behaviors from the GLSL "#extension extension_name : behavior" +// +typedef enum { + EBhMissing = 0, + EBhRequire, + EBhEnable, + EBhWarn, + EBhDisable, + EBhDisablePartial // use as initial state of an extension that is only partially implemented +} TExtensionBehavior; + +// +// Symbolic names for extensions. Strings may be directly used when calling the +// functions, but better to have the compiler do spelling checks. +// +const char* const E_GL_OES_texture_3D = "GL_OES_texture_3D"; +const char* const E_GL_OES_standard_derivatives = "GL_OES_standard_derivatives"; +const char* const E_GL_EXT_frag_depth = "GL_EXT_frag_depth"; +const char* const E_GL_OES_EGL_image_external = "GL_OES_EGL_image_external"; +const char* const E_GL_OES_EGL_image_external_essl3 = "GL_OES_EGL_image_external_essl3"; +const char* const E_GL_EXT_YUV_target = "GL_EXT_YUV_target"; +const char* const E_GL_EXT_shader_texture_lod = "GL_EXT_shader_texture_lod"; +const char* const E_GL_EXT_shadow_samplers = "GL_EXT_shadow_samplers"; + +const char* const E_GL_ARB_texture_rectangle = "GL_ARB_texture_rectangle"; +const char* const E_GL_3DL_array_objects = "GL_3DL_array_objects"; +const char* const E_GL_ARB_shading_language_420pack = "GL_ARB_shading_language_420pack"; +const char* const E_GL_ARB_texture_gather = "GL_ARB_texture_gather"; +const char* const E_GL_ARB_gpu_shader5 = "GL_ARB_gpu_shader5"; +const char* const E_GL_ARB_separate_shader_objects = "GL_ARB_separate_shader_objects"; +const char* const E_GL_ARB_compute_shader = "GL_ARB_compute_shader"; +const char* const E_GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader"; +const char* const E_GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layouts"; +const char* const E_GL_ARB_texture_cube_map_array = "GL_ARB_texture_cube_map_array"; +const char* const E_GL_ARB_texture_multisample = "GL_ARB_texture_multisample"; +const char* const E_GL_ARB_shader_texture_lod = "GL_ARB_shader_texture_lod"; +const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location"; +const char* const E_GL_ARB_explicit_uniform_location = "GL_ARB_explicit_uniform_location"; +const char* const E_GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store"; +const char* const E_GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters"; +const char* const E_GL_ARB_shader_atomic_counter_ops = "GL_ARB_shader_atomic_counter_ops"; +const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_parameters"; +const char* const E_GL_ARB_shader_group_vote = "GL_ARB_shader_group_vote"; +const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control"; +const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples"; +const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array"; +const char* const E_GL_ARB_gpu_shader_int64 = "GL_ARB_gpu_shader_int64"; +const char* const E_GL_ARB_gpu_shader_fp64 = "GL_ARB_gpu_shader_fp64"; +const char* const E_GL_ARB_shader_ballot = "GL_ARB_shader_ballot"; +const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2"; +const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp"; +const char* const E_GL_ARB_shader_stencil_export = "GL_ARB_shader_stencil_export"; +// const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members +const char* const E_GL_ARB_post_depth_coverage = "GL_ARB_post_depth_coverage"; +const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewport_layer_array"; +const char* const E_GL_ARB_fragment_shader_interlock = "GL_ARB_fragment_shader_interlock"; +const char* const E_GL_ARB_shader_clock = "GL_ARB_shader_clock"; +const char* const E_GL_ARB_uniform_buffer_object = "GL_ARB_uniform_buffer_object"; +const char* const E_GL_ARB_sample_shading = "GL_ARB_sample_shading"; +const char* const E_GL_ARB_shader_bit_encoding = "GL_ARB_shader_bit_encoding"; +const char* const E_GL_ARB_shader_image_size = "GL_ARB_shader_image_size"; +const char* const E_GL_ARB_shader_storage_buffer_object = "GL_ARB_shader_storage_buffer_object"; +const char* const E_GL_ARB_shading_language_packing = "GL_ARB_shading_language_packing"; +const char* const E_GL_ARB_texture_query_lod = "GL_ARB_texture_query_lod"; +const char* const E_GL_ARB_vertex_attrib_64bit = "GL_ARB_vertex_attrib_64bit"; +const char* const E_GL_ARB_draw_instanced = "GL_ARB_draw_instanced"; +const char* const E_GL_ARB_fragment_coord_conventions = "GL_ARB_fragment_coord_conventions"; +const char* const E_GL_ARB_bindless_texture = "GL_ARB_bindless_texture"; +const char* const E_GL_ARB_conservative_depth = "GL_ARB_conservative_depth"; + +const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic"; +const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote"; +const char* const E_GL_KHR_shader_subgroup_arithmetic = "GL_KHR_shader_subgroup_arithmetic"; +const char* const E_GL_KHR_shader_subgroup_ballot = "GL_KHR_shader_subgroup_ballot"; +const char* const E_GL_KHR_shader_subgroup_shuffle = "GL_KHR_shader_subgroup_shuffle"; +const char* const E_GL_KHR_shader_subgroup_shuffle_relative = "GL_KHR_shader_subgroup_shuffle_relative"; +const char* const E_GL_KHR_shader_subgroup_rotate = "GL_KHR_shader_subgroup_rotate"; +const char* const E_GL_KHR_shader_subgroup_clustered = "GL_KHR_shader_subgroup_clustered"; +const char* const E_GL_KHR_shader_subgroup_quad = "GL_KHR_shader_subgroup_quad"; +const char* const E_GL_KHR_memory_scope_semantics = "GL_KHR_memory_scope_semantics"; +const char* const E_GL_KHR_cooperative_matrix = "GL_KHR_cooperative_matrix"; + +const char* const E_GL_EXT_shader_atomic_int64 = "GL_EXT_shader_atomic_int64"; + +const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers"; +const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_load_formatted"; + +const char* const E_GL_EXT_shader_16bit_storage = "GL_EXT_shader_16bit_storage"; +const char* const E_GL_EXT_shader_8bit_storage = "GL_EXT_shader_8bit_storage"; + + +// EXT extensions +const char* const E_GL_EXT_device_group = "GL_EXT_device_group"; +const char* const E_GL_EXT_multiview = "GL_EXT_multiview"; +const char* const E_GL_EXT_post_depth_coverage = "GL_EXT_post_depth_coverage"; +const char* const E_GL_EXT_control_flow_attributes = "GL_EXT_control_flow_attributes"; +const char* const E_GL_EXT_nonuniform_qualifier = "GL_EXT_nonuniform_qualifier"; +const char* const E_GL_EXT_samplerless_texture_functions = "GL_EXT_samplerless_texture_functions"; +const char* const E_GL_EXT_scalar_block_layout = "GL_EXT_scalar_block_layout"; +const char* const E_GL_EXT_fragment_invocation_density = "GL_EXT_fragment_invocation_density"; +const char* const E_GL_EXT_buffer_reference = "GL_EXT_buffer_reference"; +const char* const E_GL_EXT_buffer_reference2 = "GL_EXT_buffer_reference2"; +const char* const E_GL_EXT_buffer_reference_uvec2 = "GL_EXT_buffer_reference_uvec2"; +const char* const E_GL_EXT_demote_to_helper_invocation = "GL_EXT_demote_to_helper_invocation"; +const char* const E_GL_EXT_shader_realtime_clock = "GL_EXT_shader_realtime_clock"; +const char* const E_GL_EXT_debug_printf = "GL_EXT_debug_printf"; +const char* const E_GL_EXT_ray_tracing = "GL_EXT_ray_tracing"; +const char* const E_GL_EXT_ray_query = "GL_EXT_ray_query"; +const char* const E_GL_EXT_ray_flags_primitive_culling = "GL_EXT_ray_flags_primitive_culling"; +const char* const E_GL_EXT_ray_cull_mask = "GL_EXT_ray_cull_mask"; +const char* const E_GL_EXT_blend_func_extended = "GL_EXT_blend_func_extended"; +const char* const E_GL_EXT_shader_implicit_conversions = "GL_EXT_shader_implicit_conversions"; +const char* const E_GL_EXT_fragment_shading_rate = "GL_EXT_fragment_shading_rate"; +const char* const E_GL_EXT_shader_image_int64 = "GL_EXT_shader_image_int64"; +const char* const E_GL_EXT_null_initializer = "GL_EXT_null_initializer"; +const char* const E_GL_EXT_shared_memory_block = "GL_EXT_shared_memory_block"; +const char* const E_GL_EXT_subgroup_uniform_control_flow = "GL_EXT_subgroup_uniform_control_flow"; +const char* const E_GL_EXT_spirv_intrinsics = "GL_EXT_spirv_intrinsics"; +const char* const E_GL_EXT_fragment_shader_barycentric = "GL_EXT_fragment_shader_barycentric"; +const char* const E_GL_EXT_mesh_shader = "GL_EXT_mesh_shader"; +const char* const E_GL_EXT_opacity_micromap = "GL_EXT_opacity_micromap"; +const char* const E_GL_EXT_shader_quad_control = "GL_EXT_shader_quad_control"; +const char* const E_GL_EXT_draw_instanced = "GL_EXT_draw_instanced"; +const char* const E_GL_EXT_texture_array = "GL_EXT_texture_array"; +const char* const E_GL_EXT_maximal_reconvergence = "GL_EXT_maximal_reconvergence"; +const char* const E_GL_EXT_expect_assume = "GL_EXT_expect_assume"; +const char* const E_GL_EXT_control_flow_attributes2 = "GL_EXT_control_flow_attributes2"; +const char* const E_GL_EXT_spec_constant_composites = "GL_EXT_spec_constant_composites"; +const char* const E_GL_EXT_texture_offset_non_const = "GL_EXT_texture_offset_non_const"; +const char* const E_GL_EXT_nontemporal_keyword = "GL_EXT_nontemporal_keyword"; +const char* const E_GL_EXT_uniform_buffer_unsized_array = "GL_EXT_uniform_buffer_unsized_array"; +const char* const E_GL_EXT_conservative_depth = "GL_EXT_conservative_depth"; + +// Arrays of extensions for the above viewportEXTs duplications + +const char* const post_depth_coverageEXTs[] = { E_GL_ARB_post_depth_coverage, E_GL_EXT_post_depth_coverage }; +const int Num_post_depth_coverageEXTs = sizeof(post_depth_coverageEXTs) / sizeof(post_depth_coverageEXTs[0]); + +// Array of extensions to cover both extensions providing ray tracing capabilities. +const char* const ray_tracing_EXTs[] = { E_GL_EXT_ray_query, E_GL_EXT_ray_tracing }; +const int Num_ray_tracing_EXTs = sizeof(ray_tracing_EXTs) / sizeof(ray_tracing_EXTs[0]); + +// OVR extensions +const char* const E_GL_OVR_multiview = "GL_OVR_multiview"; +const char* const E_GL_OVR_multiview2 = "GL_OVR_multiview2"; + +const char* const OVR_multiview_EXTs[] = { E_GL_OVR_multiview, E_GL_OVR_multiview2 }; +const int Num_OVR_multiview_EXTs = sizeof(OVR_multiview_EXTs) / sizeof(OVR_multiview_EXTs[0]); + +// #line and #include +const char* const E_GL_GOOGLE_cpp_style_line_directive = "GL_GOOGLE_cpp_style_line_directive"; +const char* const E_GL_GOOGLE_include_directive = "GL_GOOGLE_include_directive"; +const char* const E_GL_ARB_shading_language_include = "GL_ARB_shading_language_include"; + +const char* const E_GL_AMD_shader_ballot = "GL_AMD_shader_ballot"; +const char* const E_GL_AMD_shader_trinary_minmax = "GL_AMD_shader_trinary_minmax"; +const char* const E_GL_AMD_shader_explicit_vertex_parameter = "GL_AMD_shader_explicit_vertex_parameter"; +const char* const E_GL_AMD_gcn_shader = "GL_AMD_gcn_shader"; +const char* const E_GL_AMD_gpu_shader_half_float = "GL_AMD_gpu_shader_half_float"; +const char* const E_GL_AMD_texture_gather_bias_lod = "GL_AMD_texture_gather_bias_lod"; +const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_shader_int16"; +const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod"; +const char* const E_GL_AMD_shader_fragment_mask = "GL_AMD_shader_fragment_mask"; +const char* const E_GL_AMD_gpu_shader_half_float_fetch = "GL_AMD_gpu_shader_half_float_fetch"; +const char* const E_GL_AMD_shader_early_and_late_fragment_tests = "GL_AMD_shader_early_and_late_fragment_tests"; + +const char* const E_GL_INTEL_shader_integer_functions2 = "GL_INTEL_shader_integer_functions2"; + +const char* const E_GL_NV_sample_mask_override_coverage = "GL_NV_sample_mask_override_coverage"; +const char* const E_SPV_NV_geometry_shader_passthrough = "GL_NV_geometry_shader_passthrough"; +const char* const E_GL_NV_viewport_array2 = "GL_NV_viewport_array2"; +const char* const E_GL_NV_stereo_view_rendering = "GL_NV_stereo_view_rendering"; +const char* const E_GL_NVX_multiview_per_view_attributes = "GL_NVX_multiview_per_view_attributes"; +const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_atomic_int64"; +const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation"; +const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_noperspective_interpolation"; +const char* const E_GL_NV_shader_subgroup_partitioned = "GL_NV_shader_subgroup_partitioned"; +const char* const E_GL_NV_shading_rate_image = "GL_NV_shading_rate_image"; +const char* const E_GL_NV_ray_tracing = "GL_NV_ray_tracing"; +const char* const E_GL_NV_ray_tracing_motion_blur = "GL_NV_ray_tracing_motion_blur"; +const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragment_shader_barycentric"; +const char* const E_GL_NV_compute_shader_derivatives = "GL_NV_compute_shader_derivatives"; +const char* const E_GL_NV_shader_texture_footprint = "GL_NV_shader_texture_footprint"; +const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_shader"; +const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix"; +const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins"; +const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix"; +const char* const E_GL_NV_shader_invocation_reorder = "GL_NV_shader_invocation_reorder"; +const char* const E_GL_EXT_ray_tracing_position_fetch = "GL_EXT_ray_tracing_position_fetch"; +const char* const E_GL_NV_displacement_micromap = "GL_NV_displacement_micromap"; +const char* const E_GL_NV_shader_atomic_fp16_vector = "GL_NV_shader_atomic_fp16_vector"; +const char* const E_GL_NV_cooperative_matrix2 = "GL_NV_cooperative_matrix2"; +const char* const E_GL_NV_cooperative_vector = "GL_NV_cooperative_vector"; +const char* const E_GL_NV_cluster_acceleration_structure = "GL_NV_cluster_acceleration_structure"; +const char* const E_GL_NV_linear_swept_spheres = "GL_NV_linear_swept_spheres"; +const char* const E_GL_NV_gpu_shader5 = "GL_NV_gpu_shader5"; + +// ARM +const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader_core_builtins"; +const char* const E_GL_ARM_tensors = "GL_ARM_tensors"; + +// Arrays of extensions for the above viewportEXTs duplications + +const char* const viewportEXTs[] = { E_GL_ARB_shader_viewport_layer_array, E_GL_NV_viewport_array2 }; +const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]); + + +const char* const E_GL_QCOM_image_processing = "GL_QCOM_image_processing"; +const char* const E_GL_QCOM_image_processing2 = "GL_QCOM_image_processing2"; +const char* const E_GL_QCOM_tile_shading = "GL_QCOM_tile_shading"; +const char* const E_GL_QCOM_cooperative_matrix_conversion = "GL_QCOM_cooperative_matrix_conversion"; + +// AEP +const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a"; +const char* const E_GL_KHR_blend_equation_advanced = "GL_KHR_blend_equation_advanced"; +const char* const E_GL_OES_sample_variables = "GL_OES_sample_variables"; +const char* const E_GL_OES_shader_image_atomic = "GL_OES_shader_image_atomic"; +const char* const E_GL_OES_shader_multisample_interpolation = "GL_OES_shader_multisample_interpolation"; +const char* const E_GL_OES_texture_storage_multisample_2d_array = "GL_OES_texture_storage_multisample_2d_array"; +const char* const E_GL_EXT_geometry_shader = "GL_EXT_geometry_shader"; +const char* const E_GL_EXT_geometry_point_size = "GL_EXT_geometry_point_size"; +const char* const E_GL_EXT_gpu_shader5 = "GL_EXT_gpu_shader5"; +const char* const E_GL_EXT_primitive_bounding_box = "GL_EXT_primitive_bounding_box"; +const char* const E_GL_EXT_shader_io_blocks = "GL_EXT_shader_io_blocks"; +const char* const E_GL_EXT_tessellation_shader = "GL_EXT_tessellation_shader"; +const char* const E_GL_EXT_tessellation_point_size = "GL_EXT_tessellation_point_size"; +const char* const E_GL_EXT_texture_buffer = "GL_EXT_texture_buffer"; +const char* const E_GL_EXT_texture_cube_map_array = "GL_EXT_texture_cube_map_array"; +const char* const E_GL_EXT_shader_integer_mix = "GL_EXT_shader_integer_mix"; + +// OES matching AEP +const char* const E_GL_OES_geometry_shader = "GL_OES_geometry_shader"; +const char* const E_GL_OES_geometry_point_size = "GL_OES_geometry_point_size"; +const char* const E_GL_OES_gpu_shader5 = "GL_OES_gpu_shader5"; +const char* const E_GL_OES_primitive_bounding_box = "GL_OES_primitive_bounding_box"; +const char* const E_GL_OES_shader_io_blocks = "GL_OES_shader_io_blocks"; +const char* const E_GL_OES_tessellation_shader = "GL_OES_tessellation_shader"; +const char* const E_GL_OES_tessellation_point_size = "GL_OES_tessellation_point_size"; +const char* const E_GL_OES_texture_buffer = "GL_OES_texture_buffer"; +const char* const E_GL_OES_texture_cube_map_array = "GL_OES_texture_cube_map_array"; + +// EXT +const char* const E_GL_EXT_shader_explicit_arithmetic_types = "GL_EXT_shader_explicit_arithmetic_types"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int8 = "GL_EXT_shader_explicit_arithmetic_types_int8"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int16 = "GL_EXT_shader_explicit_arithmetic_types_int16"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int32 = "GL_EXT_shader_explicit_arithmetic_types_int32"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_int64 = "GL_EXT_shader_explicit_arithmetic_types_int64"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float16 = "GL_EXT_shader_explicit_arithmetic_types_float16"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float32 = "GL_EXT_shader_explicit_arithmetic_types_float32"; +const char* const E_GL_EXT_shader_explicit_arithmetic_types_float64 = "GL_EXT_shader_explicit_arithmetic_types_float64"; + +const char* const E_GL_EXT_shader_subgroup_extended_types_int8 = "GL_EXT_shader_subgroup_extended_types_int8"; +const char* const E_GL_EXT_shader_subgroup_extended_types_int16 = "GL_EXT_shader_subgroup_extended_types_int16"; +const char* const E_GL_EXT_shader_subgroup_extended_types_int64 = "GL_EXT_shader_subgroup_extended_types_int64"; +const char* const E_GL_EXT_shader_subgroup_extended_types_float16 = "GL_EXT_shader_subgroup_extended_types_float16"; +const char* const E_GL_EXT_terminate_invocation = "GL_EXT_terminate_invocation"; + +const char* const E_GL_EXT_shader_atomic_float = "GL_EXT_shader_atomic_float"; +const char* const E_GL_EXT_shader_atomic_float2 = "GL_EXT_shader_atomic_float2"; + +const char* const E_GL_EXT_shader_tile_image = "GL_EXT_shader_tile_image"; + +const char* const E_GL_EXT_texture_shadow_lod = "GL_EXT_texture_shadow_lod"; + +const char* const E_GL_EXT_integer_dot_product = "GL_EXT_integer_dot_product"; + +const char* const E_GL_EXT_bfloat16 = "GL_EXT_bfloat16"; +const char* const E_GL_EXT_float_e5m2 = "GL_EXT_float_e5m2"; +const char* const E_GL_EXT_float_e4m3 = "GL_EXT_float_e4m3"; +const char* const E_GL_EXT_long_vector = "GL_EXT_long_vector"; + +const char* const E_GL_EXT_shader_64bit_indexing = "GL_EXT_shader_64bit_indexing"; + +const char* const E_GL_EXT_shader_invocation_reorder = "GL_EXT_shader_invocation_reorder"; + +// Arrays of extensions for the above AEP duplications + +const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader }; +const int Num_AEP_geometry_shader = sizeof(AEP_geometry_shader)/sizeof(AEP_geometry_shader[0]); + +const char* const AEP_geometry_point_size[] = { E_GL_EXT_geometry_point_size, E_GL_OES_geometry_point_size }; +const int Num_AEP_geometry_point_size = sizeof(AEP_geometry_point_size)/sizeof(AEP_geometry_point_size[0]); + +const char* const AEP_gpu_shader5[] = { E_GL_EXT_gpu_shader5, E_GL_OES_gpu_shader5 }; +const int Num_AEP_gpu_shader5 = sizeof(AEP_gpu_shader5)/sizeof(AEP_gpu_shader5[0]); + +const char* const AEP_core_gpu_shader5[] = { E_GL_ARB_gpu_shader5, E_GL_NV_gpu_shader5}; +const int Num_AEP_core_gpu_shader5 = sizeof(AEP_core_gpu_shader5)/sizeof(AEP_core_gpu_shader5[0]); + +const char* const AEP_primitive_bounding_box[] = { E_GL_EXT_primitive_bounding_box, E_GL_OES_primitive_bounding_box }; +const int Num_AEP_primitive_bounding_box = sizeof(AEP_primitive_bounding_box)/sizeof(AEP_primitive_bounding_box[0]); + +const char* const AEP_shader_io_blocks[] = { E_GL_EXT_shader_io_blocks, E_GL_OES_shader_io_blocks }; +const int Num_AEP_shader_io_blocks = sizeof(AEP_shader_io_blocks)/sizeof(AEP_shader_io_blocks[0]); + +const char* const AEP_tessellation_shader[] = { E_GL_EXT_tessellation_shader, E_GL_OES_tessellation_shader }; +const int Num_AEP_tessellation_shader = sizeof(AEP_tessellation_shader)/sizeof(AEP_tessellation_shader[0]); + +const char* const AEP_tessellation_point_size[] = { E_GL_EXT_tessellation_point_size, E_GL_OES_tessellation_point_size }; +const int Num_AEP_tessellation_point_size = sizeof(AEP_tessellation_point_size)/sizeof(AEP_tessellation_point_size[0]); + +const char* const AEP_texture_buffer[] = { E_GL_EXT_texture_buffer, E_GL_OES_texture_buffer }; +const int Num_AEP_texture_buffer = sizeof(AEP_texture_buffer)/sizeof(AEP_texture_buffer[0]); + +const char* const AEP_texture_cube_map_array[] = { E_GL_EXT_texture_cube_map_array, E_GL_OES_texture_cube_map_array }; +const int Num_AEP_texture_cube_map_array = sizeof(AEP_texture_cube_map_array)/sizeof(AEP_texture_cube_map_array[0]); + +const char* const AEP_mesh_shader[] = { E_GL_NV_mesh_shader, E_GL_EXT_mesh_shader }; +const int Num_AEP_mesh_shader = sizeof(AEP_mesh_shader)/sizeof(AEP_mesh_shader[0]); + +} // end namespace glslang + +#endif // _VERSIONS_INCLUDED_ diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/Public/ResourceLimits.h b/app/libs/ncnn/armeabi-v7a/include/glslang/Public/ResourceLimits.h new file mode 100644 index 0000000..8245e12 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/Public/ResourceLimits.h @@ -0,0 +1,58 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of Google Inc. 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 HOLDERS 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. + +#ifndef _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ +#define _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ + +#include + +#include "../Include/ResourceLimits.h" +#include "../Include/visibility.h" + +// Return pointer to user-writable Resource to pass through API in +// future-proof way. +GLSLANG_EXPORT extern TBuiltInResource* GetResources(); + +// These are the default resources for TBuiltInResources, used for both +// - parsing this string for the case where the user didn't supply one, +// - dumping out a template for user construction of a config file. +GLSLANG_EXPORT extern const TBuiltInResource* GetDefaultResources(); + +// Returns the DefaultTBuiltInResource as a human-readable string. +GLSLANG_EXPORT std::string GetDefaultTBuiltInResourceString(); + +// Decodes the resource limits from |config| to |resources|. +GLSLANG_EXPORT void DecodeResourceLimits(TBuiltInResource* resources, char* config); + +#endif // _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/Public/ShaderLang.h b/app/libs/ncnn/armeabi-v7a/include/glslang/Public/ShaderLang.h new file mode 100644 index 0000000..8ca4ed9 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/Public/ShaderLang.h @@ -0,0 +1,1012 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. +// +#ifndef _COMPILER_INTERFACE_INCLUDED_ +#define _COMPILER_INTERFACE_INCLUDED_ + +#include "../Include/ResourceLimits.h" +#include "../Include/visibility.h" +#include "../MachineIndependent/Versions.h" + +#include +#include + +#ifdef _WIN32 + #define C_DECL __cdecl +#else + #define C_DECL +#endif + +// +// This is the platform independent interface between an OGL driver +// and the shading language compiler/linker. +// + +#ifdef __cplusplus + extern "C" { +#endif + +// +// Call before doing any other compiler/linker operations. +// +// (Call once per process, not once per thread.) +// +GLSLANG_EXPORT int ShInitialize(); + +// +// Call this at process shutdown to clean up memory. +// +GLSLANG_EXPORT int ShFinalize(); + +// +// Types of languages the compiler can consume. +// +typedef enum { + EShLangVertex, + EShLangTessControl, + EShLangTessEvaluation, + EShLangGeometry, + EShLangFragment, + EShLangCompute, + EShLangRayGen, + EShLangRayGenNV = EShLangRayGen, + EShLangIntersect, + EShLangIntersectNV = EShLangIntersect, + EShLangAnyHit, + EShLangAnyHitNV = EShLangAnyHit, + EShLangClosestHit, + EShLangClosestHitNV = EShLangClosestHit, + EShLangMiss, + EShLangMissNV = EShLangMiss, + EShLangCallable, + EShLangCallableNV = EShLangCallable, + EShLangTask, + EShLangTaskNV = EShLangTask, + EShLangMesh, + EShLangMeshNV = EShLangMesh, + LAST_ELEMENT_MARKER(EShLangCount), +} EShLanguage; // would be better as stage, but this is ancient now + +typedef enum : unsigned { + EShLangVertexMask = (1 << EShLangVertex), + EShLangTessControlMask = (1 << EShLangTessControl), + EShLangTessEvaluationMask = (1 << EShLangTessEvaluation), + EShLangGeometryMask = (1 << EShLangGeometry), + EShLangFragmentMask = (1 << EShLangFragment), + EShLangComputeMask = (1 << EShLangCompute), + EShLangRayGenMask = (1 << EShLangRayGen), + EShLangRayGenNVMask = EShLangRayGenMask, + EShLangIntersectMask = (1 << EShLangIntersect), + EShLangIntersectNVMask = EShLangIntersectMask, + EShLangAnyHitMask = (1 << EShLangAnyHit), + EShLangAnyHitNVMask = EShLangAnyHitMask, + EShLangClosestHitMask = (1 << EShLangClosestHit), + EShLangClosestHitNVMask = EShLangClosestHitMask, + EShLangMissMask = (1 << EShLangMiss), + EShLangMissNVMask = EShLangMissMask, + EShLangCallableMask = (1 << EShLangCallable), + EShLangCallableNVMask = EShLangCallableMask, + EShLangTaskMask = (1 << EShLangTask), + EShLangTaskNVMask = EShLangTaskMask, + EShLangMeshMask = (1 << EShLangMesh), + EShLangMeshNVMask = EShLangMeshMask, + LAST_ELEMENT_MARKER(EShLanguageMaskCount), +} EShLanguageMask; + +namespace glslang { + +class TType; + +typedef enum { + EShSourceNone, + EShSourceGlsl, // GLSL, includes ESSL (OpenGL ES GLSL) + EShSourceHlsl, // HLSL + LAST_ELEMENT_MARKER(EShSourceCount), +} EShSource; // if EShLanguage were EShStage, this could be EShLanguage instead + +typedef enum { + EShClientNone, // use when there is no client, e.g. for validation + EShClientVulkan, // as GLSL dialect, specifies KHR_vulkan_glsl extension + EShClientOpenGL, // as GLSL dialect, specifies ARB_gl_spirv extension + LAST_ELEMENT_MARKER(EShClientCount), +} EShClient; + +typedef enum { + EShTargetNone, + EShTargetSpv, // SPIR-V (preferred spelling) + EshTargetSpv = EShTargetSpv, // legacy spelling + LAST_ELEMENT_MARKER(EShTargetCount), +} EShTargetLanguage; + +typedef enum { + EShTargetVulkan_1_0 = (1 << 22), // Vulkan 1.0 + EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), // Vulkan 1.1 + EShTargetVulkan_1_2 = (1 << 22) | (2 << 12), // Vulkan 1.2 + EShTargetVulkan_1_3 = (1 << 22) | (3 << 12), // Vulkan 1.3 + EShTargetVulkan_1_4 = (1 << 22) | (4 << 12), // Vulkan 1.4 + EShTargetOpenGL_450 = 450, // OpenGL + LAST_ELEMENT_MARKER(EShTargetClientVersionCount = 6), +} EShTargetClientVersion; + +typedef EShTargetClientVersion EshTargetClientVersion; + +typedef enum { + EShTargetSpv_1_0 = (1 << 16), // SPIR-V 1.0 + EShTargetSpv_1_1 = (1 << 16) | (1 << 8), // SPIR-V 1.1 + EShTargetSpv_1_2 = (1 << 16) | (2 << 8), // SPIR-V 1.2 + EShTargetSpv_1_3 = (1 << 16) | (3 << 8), // SPIR-V 1.3 + EShTargetSpv_1_4 = (1 << 16) | (4 << 8), // SPIR-V 1.4 + EShTargetSpv_1_5 = (1 << 16) | (5 << 8), // SPIR-V 1.5 + EShTargetSpv_1_6 = (1 << 16) | (6 << 8), // SPIR-V 1.6 + LAST_ELEMENT_MARKER(EShTargetLanguageVersionCount = 7), +} EShTargetLanguageVersion; + +// +// Following are a series of helper enums for managing layouts and qualifiers, +// used for TPublicType, TType, others. +// + +enum TLayoutPacking { + ElpNone, + ElpShared, // default, but different than saying nothing + ElpStd140, + ElpStd430, + ElpPacked, + ElpScalar, + ElpCount // If expanding, see bitfield width below +}; + +struct TInputLanguage { + EShSource languageFamily; // redundant information with other input, this one overrides when not EShSourceNone + EShLanguage stage; // redundant information with other input, this one overrides when not EShSourceNone + EShClient dialect; + int dialectVersion; // version of client's language definition, not the client (when not EShClientNone) + bool vulkanRulesRelaxed; +}; + +struct TClient { + EShClient client; + EShTargetClientVersion version; // version of client itself (not the client's input dialect) +}; + +struct TTarget { + EShTargetLanguage language; + EShTargetLanguageVersion version; // version to target, if SPIR-V, defined by "word 1" of the SPIR-V header + bool hlslFunctionality1; // can target hlsl_functionality1 extension(s) +}; + +// All source/client/target versions and settings. +// Can override previous methods of setting, when items are set here. +// Expected to grow, as more are added, rather than growing parameter lists. +struct TEnvironment { + TInputLanguage input; // definition of the input language + TClient client; // what client is the overall compilation being done for? + TTarget target; // what to generate +}; + +GLSLANG_EXPORT const char* StageName(EShLanguage); + +} // end namespace glslang + +// +// Types of output the linker will create. +// +typedef enum { + EShExVertexFragment, + EShExFragment +} EShExecutable; + +// +// Optimization level for the compiler. +// +typedef enum { + EShOptNoGeneration, + EShOptNone, + EShOptSimple, // Optimizations that can be done quickly + EShOptFull, // Optimizations that will take more time + LAST_ELEMENT_MARKER(EshOptLevelCount), +} EShOptimizationLevel; + +// +// Texture and Sampler transformation mode. +// +typedef enum { + EShTexSampTransKeep, // keep textures and samplers as is (default) + EShTexSampTransUpgradeTextureRemoveSampler, // change texture w/o embeded sampler into sampled texture and throw away all samplers + LAST_ELEMENT_MARKER(EShTexSampTransCount), +} EShTextureSamplerTransformMode; + +// +// Message choices for what errors and warnings are given. +// +enum EShMessages : unsigned { + EShMsgDefault = 0, // default is to give all required errors and extra warnings + EShMsgRelaxedErrors = (1 << 0), // be liberal in accepting input + EShMsgSuppressWarnings = (1 << 1), // suppress all warnings, except those required by the specification + EShMsgAST = (1 << 2), // print the AST intermediate representation + EShMsgSpvRules = (1 << 3), // issue messages for SPIR-V generation + EShMsgVulkanRules = (1 << 4), // issue messages for Vulkan-requirements of GLSL for SPIR-V + EShMsgOnlyPreprocessor = (1 << 5), // only print out errors produced by the preprocessor + EShMsgReadHlsl = (1 << 6), // use HLSL parsing rules and semantics + EShMsgCascadingErrors = (1 << 7), // get cascading errors; risks error-recovery issues, instead of an early exit + EShMsgKeepUncalled = (1 << 8), // for testing, don't eliminate uncalled functions + EShMsgHlslOffsets = (1 << 9), // allow block offsets to follow HLSL rules instead of GLSL rules + EShMsgDebugInfo = (1 << 10), // save debug information + EShMsgHlslEnable16BitTypes = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL + EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages + EShMsgHlslDX9Compatible = (1 << 13), // enable HLSL DX9 compatible mode (for samplers and semantics) + EShMsgBuiltinSymbolTable = (1 << 14), // print the builtin symbol table + EShMsgEnhanced = (1 << 15), // enhanced message readability + EShMsgAbsolutePath = (1 << 16), // Output Absolute path for messages + EShMsgDisplayErrorColumn = (1 << 17), // Display error message column aswell as line + EShMsgLinkTimeOptimization = (1 << 18), // perform cross-stage optimizations during linking + EShMsgValidateCrossStageIO = (1 << 19), // validate shader inputs have matching outputs in previous stage + LAST_ELEMENT_MARKER(EShMsgCount), +}; + +// +// Options for building reflection +// +typedef enum { + EShReflectionDefault = 0, // default is original behaviour before options were added + EShReflectionStrictArraySuffix = (1 << 0), // reflection will follow stricter rules for array-of-structs suffixes + EShReflectionBasicArraySuffix = (1 << 1), // arrays of basic types will be appended with [0] as in GL reflection + EShReflectionIntermediateIO = (1 << 2), // reflect inputs and outputs to program, even with no vertex shader + EShReflectionSeparateBuffers = (1 << 3), // buffer variables and buffer blocks are reflected separately + EShReflectionAllBlockVariables = (1 << 4), // reflect all variables in blocks, even if they are inactive + EShReflectionUnwrapIOBlocks = (1 << 5), // unwrap input/output blocks the same as with uniform blocks + EShReflectionAllIOVariables = (1 << 6), // reflect all input/output variables, even if they are inactive + EShReflectionSharedStd140SSBO = (1 << 7), // Apply std140/shared rules for ubo to ssbo + EShReflectionSharedStd140UBO = (1 << 8), // Apply std140/shared rules for ubo to ssbo + LAST_ELEMENT_MARKER(EShReflectionCount), +} EShReflectionOptions; + +// +// Build a table for bindings. This can be used for locating +// attributes, uniforms, globals, etc., as needed. +// +typedef struct { + const char* name; + int binding; +} ShBinding; + +typedef struct { + int numBindings; + ShBinding* bindings; // array of bindings +} ShBindingTable; + +// +// ShHandle held by but opaque to the driver. It is allocated, +// managed, and de-allocated by the compiler/linker. Its contents +// are defined by and used by the compiler and linker. For example, +// symbol table information and object code passed from the compiler +// to the linker can be stored where ShHandle points. +// +// If handle creation fails, 0 will be returned. +// +typedef void* ShHandle; + +// +// Driver calls these to create and destroy compiler/linker +// objects. +// +GLSLANG_EXPORT ShHandle ShConstructCompiler(const EShLanguage, int /*debugOptions unused*/); // one per shader +GLSLANG_EXPORT ShHandle ShConstructLinker(const EShExecutable, int /*debugOptions unused*/); // one per shader pair +GLSLANG_EXPORT ShHandle ShConstructUniformMap(); // one per uniform namespace (currently entire program object) +GLSLANG_EXPORT void ShDestruct(ShHandle); + +// +// The return value of ShCompile is boolean, non-zero indicating +// success. +// +// The info-log should be written by ShCompile into +// ShHandle, so it can answer future queries. +// +GLSLANG_EXPORT int ShCompile(const ShHandle, const char* const shaderStrings[], const int numStrings, + const int* lengths, const EShOptimizationLevel, const TBuiltInResource* resources, + int, // debugOptions unused + int defaultVersion = 110, // use 100 for ES environment, overridden by #version in shader + bool forwardCompatible = false, // give errors for use of deprecated features + EShMessages messages = EShMsgDefault, // warnings and errors + const char* fileName = nullptr +); + +GLSLANG_EXPORT int ShLinkExt( + const ShHandle, // linker object + const ShHandle h[], // compiler objects to link together + const int numHandles); + +// +// ShSetEncrpytionMethod is a place-holder for specifying +// how source code is encrypted. +// +GLSLANG_EXPORT void ShSetEncryptionMethod(ShHandle); + +// +// All the following return 0 if the information is not +// available in the object passed down, or the object is bad. +// +GLSLANG_EXPORT const char* ShGetInfoLog(const ShHandle); +GLSLANG_EXPORT const void* ShGetExecutable(const ShHandle); +GLSLANG_EXPORT int ShSetVirtualAttributeBindings(const ShHandle, const ShBindingTable*); // to detect user aliasing +GLSLANG_EXPORT int ShSetFixedAttributeBindings(const ShHandle, const ShBindingTable*); // to force any physical mappings +// +// Tell the linker to never assign a vertex attribute to this list of physical attributes +// +GLSLANG_EXPORT int ShExcludeAttributes(const ShHandle, int *attributes, int count); + +// +// Returns the location ID of the named uniform. +// Returns -1 if error. +// +GLSLANG_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* name); + +#ifdef __cplusplus + } // end extern "C" +#endif + +//////////////////////////////////////////////////////////////////////////////////////////// +// +// Deferred-Lowering C++ Interface +// ----------------------------------- +// +// Below is a new alternate C++ interface, which deprecates the above +// opaque handle-based interface. +// +// The below is further designed to handle multiple compilation units per stage, where +// the intermediate results, including the parse tree, are preserved until link time, +// rather than the above interface which is designed to have each compilation unit +// lowered at compile time. In the above model, linking occurs on the lowered results, +// whereas in this model intra-stage linking can occur at the parse tree +// (treeRoot in TIntermediate) level, and then a full stage can be lowered. +// + +#include +#include +#include + +class TCompiler; +class TInfoSink; + +namespace glslang { + +struct Version { + int major; + int minor; + int patch; + const char* flavor; +}; + +GLSLANG_EXPORT Version GetVersion(); +GLSLANG_EXPORT const char* GetEsslVersionString(); +GLSLANG_EXPORT const char* GetGlslVersionString(); +GLSLANG_EXPORT int GetKhronosToolId(); + +class TIntermediate; +class TProgram; +class TPoolAllocator; +class TIoMapResolver; + +// Call this exactly once per process before using anything else +GLSLANG_EXPORT bool InitializeProcess(); + +// Call once per process to tear down everything +GLSLANG_EXPORT void FinalizeProcess(); + +// Resource type for IO resolver +enum TResourceType { + EResSampler, + EResTexture, + EResImage, + EResUbo, + EResSsbo, + EResUav, + EResCombinedSampler, + EResAs, + EResTensor, + EResCount +}; + +enum TBlockStorageClass +{ + EbsUniform = 0, + EbsStorageBuffer, + EbsPushConstant, + EbsNone, // not a uniform or buffer variable + EbsCount, +}; + +// Make one TShader per shader that you will link into a program. Then +// - provide the shader through setStrings() or setStringsWithLengths() +// - optionally call setEnv*(), see below for more detail +// - optionally use setPreamble() to set a special shader string that will be +// processed before all others but won't affect the validity of #version +// - optionally call addProcesses() for each setting/transform, +// see comment for class TProcesses +// - call parse(): source language and target environment must be selected +// either by correct setting of EShMessages sent to parse(), or by +// explicitly calling setEnv*() +// - query the info logs +// +// N.B.: Does not yet support having the same TShader instance being linked into +// multiple programs. +// +// N.B.: Destruct a linked program *before* destructing the shaders linked into it. +// +class GLSLANG_EXPORT TShader { +public: + explicit TShader(EShLanguage); + virtual ~TShader(); + void setStrings(const char* const* s, int n); + void setStringsWithLengths( + const char* const* s, const int* l, int n); + void setStringsWithLengthsAndNames( + const char* const* s, const int* l, const char* const* names, int n); + void setPreamble(const char* s) { preamble = s; } + void setEntryPoint(const char* entryPoint); + void setSourceEntryPoint(const char* sourceEntryPointName); + void addProcesses(const std::vector&); + void setUniqueId(unsigned long long id); + void setOverrideVersion(int version); + void setDebugInfo(bool debugInfo); + + // IO resolver binding data: see comments in ShaderLang.cpp + void setShiftBinding(TResourceType res, unsigned int base); + void setShiftSamplerBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftTextureBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftImageBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftUboBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftUavBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftCbufferBinding(unsigned int base); // synonym for setShiftUboBinding + void setShiftSsboBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set); + void setResourceSetBinding(const std::vector& base); + void setAutoMapBindings(bool map); + void setAutoMapLocations(bool map); + void addUniformLocationOverride(const char* name, int loc); + void setUniformLocationBase(int base); + void setInvertY(bool invert); + void setDxPositionW(bool dxPosW); + void setEnhancedMsgs(); +#ifdef ENABLE_HLSL + void setHlslIoMapping(bool hlslIoMap); + void setFlattenUniformArrays(bool flatten); +#endif + void setNoStorageFormat(bool useUnknownFormat); + void setNanMinMaxClamp(bool nanMinMaxClamp); + void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode); + void addBlockStorageOverride(const char* nameStr, glslang::TBlockStorageClass backing); + + void setGlobalUniformBlockName(const char* name); + void setAtomicCounterBlockName(const char* name); + void setGlobalUniformSet(unsigned int set); + void setGlobalUniformBinding(unsigned int binding); + void setAtomicCounterBlockSet(unsigned int set); + void setAtomicCounterBlockBinding(unsigned int binding); + + void addSourceText(const char* text, size_t len); + void setSourceFile(const char* file); + + // For setting up the environment (cleared to nothingness in the constructor). + // These must be called so that parsing is done for the right source language and + // target environment, either indirectly through TranslateEnvironment() based on + // EShMessages et. al., or directly by the user. + // + // setEnvInput: The input source language and stage. If generating code for a + // specific client, the input client semantics to use and the + // version of that client's input semantics to use, otherwise + // use EShClientNone and version of 0, e.g. for validation mode. + // Note 'version' does not describe the target environment, + // just the version of the source dialect to compile under. + // For example, to choose the Vulkan dialect of GLSL defined by + // version 100 of the KHR_vulkan_glsl extension: lang = EShSourceGlsl, + // dialect = EShClientVulkan, and version = 100. + // + // See the definitions of TEnvironment, EShSource, EShLanguage, + // and EShClient for choices and more detail. + // + // setEnvClient: The client that will be hosting the execution, and its version. + // Note 'version' is not the version of the languages involved, but + // the version of the client environment. + // Use EShClientNone and version of 0 if there is no client, e.g. + // for validation mode. + // + // See EShTargetClientVersion for choices. + // + // setEnvTarget: The language to translate to when generating code, and that + // language's version. + // Use EShTargetNone and version of 0 if there is no client, e.g. + // for validation mode. + // + void setEnvInput(EShSource lang, EShLanguage envStage, EShClient client, int version) + { + environment.input.languageFamily = lang; + environment.input.stage = envStage; + environment.input.dialect = client; + environment.input.dialectVersion = version; + } + void setEnvClient(EShClient client, EShTargetClientVersion version) + { + environment.client.client = client; + environment.client.version = version; + } + void setEnvTarget(EShTargetLanguage lang, EShTargetLanguageVersion version) + { + environment.target.language = lang; + environment.target.version = version; + } + + void getStrings(const char* const* &s, int& n) { s = strings; n = numStrings; } + +#ifdef ENABLE_HLSL + void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; } + bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; } +#else + bool getEnvTargetHlslFunctionality1() const { return false; } +#endif + + void setEnvInputVulkanRulesRelaxed() { environment.input.vulkanRulesRelaxed = true; } + bool getEnvInputVulkanRulesRelaxed() const { return environment.input.vulkanRulesRelaxed; } + + void setCompileOnly() { compileOnly = true; } + bool getCompileOnly() const { return compileOnly; } + + // Interface to #include handlers. + // + // To support #include, a client of Glslang does the following: + // 1. Call setStringsWithNames to set the source strings and associated + // names. For example, the names could be the names of the files + // containing the shader sources. + // 2. Call parse with an Includer. + // + // When the Glslang parser encounters an #include directive, it calls + // the Includer's include method with the requested include name + // together with the current string name. The returned IncludeResult + // contains the fully resolved name of the included source, together + // with the source text that should replace the #include directive + // in the source stream. After parsing that source, Glslang will + // release the IncludeResult object. + class Includer { + public: + // An IncludeResult contains the resolved name and content of a source + // inclusion. + struct IncludeResult { + IncludeResult(const std::string& headerName, const char* const headerData, const size_t headerLength, void* userData) : + headerName(headerName), headerData(headerData), headerLength(headerLength), userData(userData) { } + // For a successful inclusion, the fully resolved name of the requested + // include. For example, in a file system-based includer, full resolution + // should convert a relative path name into an absolute path name. + // For a failed inclusion, this is an empty string. + const std::string headerName; + // The content and byte length of the requested inclusion. The + // Includer producing this IncludeResult retains ownership of the + // storage. + // For a failed inclusion, the header + // field points to a string containing error details. + const char* const headerData; + const size_t headerLength; + // Include resolver's context. + void* userData; + protected: + IncludeResult& operator=(const IncludeResult&); + IncludeResult(); + }; + + // For both include methods below: + // + // Resolves an inclusion request by name, current source name, + // and include depth. + // On success, returns an IncludeResult containing the resolved name + // and content of the include. + // On failure, returns a nullptr, or an IncludeResult + // with an empty string for the headerName and error details in the + // header field. + // The Includer retains ownership of the contents + // of the returned IncludeResult value, and those contents must + // remain valid until the releaseInclude method is called on that + // IncludeResult object. + // + // Note "local" vs. "system" is not an "either/or": "local" is an + // extra thing to do over "system". Both might get called, as per + // the C++ specification. + + // For the "system" or <>-style includes; search the "system" paths. + virtual IncludeResult* includeSystem(const char* /*headerName*/, + const char* /*includerName*/, + size_t /*inclusionDepth*/) { return nullptr; } + + // For the "local"-only aspect of a "" include. Should not search in the + // "system" paths, because on returning a failure, the parser will + // call includeSystem() to look in the "system" locations. + virtual IncludeResult* includeLocal(const char* /*headerName*/, + const char* /*includerName*/, + size_t /*inclusionDepth*/) { return nullptr; } + + // Signals that the parser will no longer use the contents of the + // specified IncludeResult. + virtual void releaseInclude(IncludeResult*) = 0; + virtual ~Includer() {} + }; + + // Fail all Includer searches + class ForbidIncluder : public Includer { + public: + virtual void releaseInclude(IncludeResult*) override { } + }; + + bool parse( + const TBuiltInResource*, int defaultVersion, EProfile defaultProfile, + bool forceDefaultVersionAndProfile, bool forwardCompatible, + EShMessages, Includer&); + + bool parse(const TBuiltInResource* res, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, + bool forwardCompatible, EShMessages messages) + { + TShader::ForbidIncluder includer; + return parse(res, defaultVersion, defaultProfile, forceDefaultVersionAndProfile, forwardCompatible, messages, includer); + } + + // Equivalent to parse() without a default profile and without forcing defaults. + bool parse(const TBuiltInResource* builtInResources, int defaultVersion, bool forwardCompatible, EShMessages messages) + { + return parse(builtInResources, defaultVersion, ENoProfile, false, forwardCompatible, messages); + } + + bool parse(const TBuiltInResource* builtInResources, int defaultVersion, bool forwardCompatible, EShMessages messages, + Includer& includer) + { + return parse(builtInResources, defaultVersion, ENoProfile, false, forwardCompatible, messages, includer); + } + + // NOTE: Doing just preprocessing to obtain a correct preprocessed shader string + // is not an officially supported or fully working path. + bool preprocess( + const TBuiltInResource* builtInResources, int defaultVersion, + EProfile defaultProfile, bool forceDefaultVersionAndProfile, + bool forwardCompatible, EShMessages message, std::string* outputString, + Includer& includer); + + const char* getInfoLog(); + const char* getInfoDebugLog(); + EShLanguage getStage() const { return stage; } + TIntermediate* getIntermediate() const { return intermediate; } + +protected: + TPoolAllocator* pool; + EShLanguage stage; + TCompiler* compiler; + TIntermediate* intermediate; + TInfoSink* infoSink; + // strings and lengths follow the standard for glShaderSource: + // strings is an array of numStrings pointers to string data. + // lengths can be null, but if not it is an array of numStrings + // integers containing the length of the associated strings. + // if lengths is null or lengths[n] < 0 the associated strings[n] is + // assumed to be null-terminated. + // stringNames is the optional names for all the strings. If stringNames + // is null, then none of the strings has name. If a certain element in + // stringNames is null, then the corresponding string does not have name. + const char* const* strings; // explicit code to compile, see previous comment + const int* lengths; + const char* const* stringNames; + int numStrings; // size of the above arrays + const char* preamble; // string of implicit code to compile before the explicitly provided code + + // a function in the source string can be renamed FROM this TO the name given in setEntryPoint. + std::string sourceEntryPointName; + + // overrides #version in shader source or default version if #version isn't present + int overrideVersion; + + TEnvironment environment; + + // Indicates this shader is meant to be used without linking + bool compileOnly = false; + + friend class TProgram; + +private: + TShader& operator=(TShader&); +}; + +// +// A reflection database and its interface, consistent with the OpenGL API reflection queries. +// + +// Data needed for just a single object at the granularity exchanged by the reflection API +class GLSLANG_EXPORT TObjectReflection { +public: + TObjectReflection(const std::string& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex); + + const TType* getType() const { return type; } + int getBinding() const; + void dump() const; + static TObjectReflection badReflection() { return TObjectReflection(); } + + unsigned int layoutLocation() const; + + std::string name; + int offset; + int glDefineType; + int size; // data size in bytes for a block, array size for a (non-block) object that's an array + int index; + int counterIndex; + int numMembers; + int arrayStride; // stride of an array variable + int topLevelArraySize; // size of the top-level variable in a storage buffer member + int topLevelArrayStride; // stride of the top-level variable in a storage buffer member + EShLanguageMask stages; + +protected: + TObjectReflection() + : offset(-1), glDefineType(-1), size(-1), index(-1), counterIndex(-1), numMembers(-1), arrayStride(0), + topLevelArrayStride(0), stages(EShLanguageMask(0)), type(nullptr) + { + } + + const TType* type; +}; + +class TReflection; +class TIoMapper; +struct TVarEntryInfo; + +// Allows to customize the binding layout after linking. +// All used uniform variables will invoke at least validateBinding. +// If validateBinding returned true then the other resolveBinding, +// resolveSet, and resolveLocation are invoked to resolve the binding +// and descriptor set index respectively. +// +// Invocations happen in a particular order: +// 1) all shader inputs +// 2) all shader outputs +// 3) all uniforms with binding and set already defined +// 4) all uniforms with binding but no set defined +// 5) all uniforms with set but no binding defined +// 6) all uniforms with no binding and no set defined +// +// mapIO will use this resolver in two phases. The first +// phase is a notification phase, calling the corresponging +// notifiy callbacks, this phase ends with a call to endNotifications. +// Phase two starts directly after the call to endNotifications +// and calls all other callbacks to validate and to get the +// bindings, sets, locations, component and color indices. +// +// NOTE: that still limit checks are applied to bindings and sets +// and may result in an error. +class GLSLANG_EXPORT TIoMapResolver { +public: + virtual ~TIoMapResolver() {} + + // Should return true if the resulting/current binding would be okay. + // Basic idea is to do aliasing binding checks with this. + virtual bool validateBinding(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current binding should be overridden. + // Return -1 if the current binding (including no binding) should be kept. + virtual int resolveBinding(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current set should be overridden. + // Return -1 if the current set (including no set) should be kept. + virtual int resolveSet(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current location should be overridden. + // Return -1 if the current location (including no location) should be kept. + virtual int resolveUniformLocation(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return true if the resulting/current setup would be okay. + // Basic idea is to do aliasing checks and reject invalid semantic names. + virtual bool validateInOut(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current location should be overridden. + // Return -1 if the current location (including no location) should be kept. + virtual int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current component index should be overridden. + // Return -1 if the current component index (including no index) should be kept. + virtual int resolveInOutComponent(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Should return a value >= 0 if the current color index should be overridden. + // Return -1 if the current color index (including no index) should be kept. + virtual int resolveInOutIndex(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Notification of a uniform variable + virtual void notifyBinding(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Notification of a in or out variable + virtual void notifyInOut(EShLanguage stage, TVarEntryInfo& ent) = 0; + // Called by mapIO when it starts its notify pass for the given stage + virtual void beginNotifications(EShLanguage stage) = 0; + // Called by mapIO when it has finished the notify pass + virtual void endNotifications(EShLanguage stage) = 0; + // Called by mipIO when it starts its resolve pass for the given stage + virtual void beginResolve(EShLanguage stage) = 0; + // Called by mapIO when it has finished the resolve pass + virtual void endResolve(EShLanguage stage) = 0; + // Called by mapIO when it starts its symbol collect for teh given stage + virtual void beginCollect(EShLanguage stage) = 0; + // Called by mapIO when it has finished the symbol collect + virtual void endCollect(EShLanguage stage) = 0; + // Called by TSlotCollector to resolve storage locations or bindings + virtual void reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) = 0; + // Called by TSlotCollector to resolve resource locations or bindings + virtual void reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) = 0; + // Called by mapIO.addStage to set shader stage mask to mark a stage be added to this pipeline + virtual void addStage(EShLanguage stage, TIntermediate& stageIntermediate) = 0; +}; + +// I/O mapper +class TIoMapper { +public: + TIoMapper() {} + virtual ~TIoMapper() {} + // grow the reflection stage by stage + bool virtual addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*); + bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; } + bool virtual setAutoPushConstantBlock(const char*, unsigned int, TLayoutPacking) { return false; } +}; + +// Get the default GLSL IO mapper +GLSLANG_EXPORT TIoMapper* GetGlslIoMapper(); + +// Make one TProgram per set of shaders that will get linked together. Add all +// the shaders that are to be linked together. After calling shader.parse() +// for all shaders, call link(). +// +// N.B.: Destruct a linked program *before* destructing the shaders linked into it. +// +class GLSLANG_EXPORT TProgram { +public: + TProgram(); + virtual ~TProgram(); + void addShader(TShader* shader) { stages[shader->stage].push_back(shader); } + std::list& getShaders(EShLanguage stage) { return stages[stage]; } + // Link Validation interface + bool link(EShMessages); + const char* getInfoLog(); + const char* getInfoDebugLog(); + + TIntermediate* getIntermediate(EShLanguage stage) const { return intermediate[stage]; } + + // Reflection Interface + + // call first, to do liveness analysis, index mapping, etc.; returns false on failure + bool buildReflection(int opts = EShReflectionDefault); + unsigned getLocalSize(int dim) const; // return dim'th local size + unsigned getTileShadingRateQCOM(int dim) const; // return dim'th tile shading rate QCOM + int getReflectionIndex(const char *name) const; + int getReflectionPipeIOIndex(const char* name, const bool inOrOut) const; + int getNumUniformVariables() const; + const TObjectReflection& getUniform(int index) const; + int getNumUniformBlocks() const; + const TObjectReflection& getUniformBlock(int index) const; + int getNumPipeInputs() const; + const TObjectReflection& getPipeInput(int index) const; + int getNumPipeOutputs() const; + const TObjectReflection& getPipeOutput(int index) const; + int getNumBufferVariables() const; + const TObjectReflection& getBufferVariable(int index) const; + int getNumBufferBlocks() const; + const TObjectReflection& getBufferBlock(int index) const; + int getNumAtomicCounters() const; + const TObjectReflection& getAtomicCounter(int index) const; + + // Legacy Reflection Interface - expressed in terms of above interface + + // can be used for glGetProgramiv(GL_ACTIVE_UNIFORMS) + int getNumLiveUniformVariables() const { return getNumUniformVariables(); } + + // can be used for glGetProgramiv(GL_ACTIVE_UNIFORM_BLOCKS) + int getNumLiveUniformBlocks() const { return getNumUniformBlocks(); } + + // can be used for glGetProgramiv(GL_ACTIVE_ATTRIBUTES) + int getNumLiveAttributes() const { return getNumPipeInputs(); } + + // can be used for glGetUniformIndices() + int getUniformIndex(const char *name) const { return getReflectionIndex(name); } + + int getPipeIOIndex(const char *name, const bool inOrOut) const + { return getReflectionPipeIOIndex(name, inOrOut); } + + // can be used for "name" part of glGetActiveUniform() + const char *getUniformName(int index) const { return getUniform(index).name.c_str(); } + + // returns the binding number + int getUniformBinding(int index) const { return getUniform(index).getBinding(); } + + // returns Shaders Stages where a Uniform is present + EShLanguageMask getUniformStages(int index) const { return getUniform(index).stages; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX) + int getUniformBlockIndex(int index) const { return getUniform(index).index; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE) + int getUniformType(int index) const { return getUniform(index).glDefineType; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_OFFSET) + int getUniformBufferOffset(int index) const { return getUniform(index).offset; } + + // can be used for glGetActiveUniformsiv(GL_UNIFORM_SIZE) + int getUniformArraySize(int index) const { return getUniform(index).size; } + + // returns a TType* + const TType *getUniformTType(int index) const { return getUniform(index).getType(); } + + // can be used for glGetActiveUniformBlockName() + const char *getUniformBlockName(int index) const { return getUniformBlock(index).name.c_str(); } + + // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE) + int getUniformBlockSize(int index) const { return getUniformBlock(index).size; } + + // returns the block binding number + int getUniformBlockBinding(int index) const { return getUniformBlock(index).getBinding(); } + + // returns block index of associated counter. + int getUniformBlockCounterIndex(int index) const { return getUniformBlock(index).counterIndex; } + + // returns a TType* + const TType *getUniformBlockTType(int index) const { return getUniformBlock(index).getType(); } + + // can be used for glGetActiveAttrib() + const char *getAttributeName(int index) const { return getPipeInput(index).name.c_str(); } + + // can be used for glGetActiveAttrib() + int getAttributeType(int index) const { return getPipeInput(index).glDefineType; } + + // returns a TType* + const TType *getAttributeTType(int index) const { return getPipeInput(index).getType(); } + + void dumpReflection(); + + // Get the IO resolver to use for mapIO + TIoMapResolver* getGlslIoResolver(EShLanguage stage); + + // I/O mapping: apply base offsets and map live unbound variables + // If resolver is not provided it uses the previous approach + // and respects auto assignment and offsets. + bool mapIO(TIoMapResolver* pResolver = nullptr, TIoMapper* pIoMapper = nullptr); + +protected: + bool linkStage(EShLanguage, EShMessages); + bool crossStageCheck(EShMessages); + + TPoolAllocator* pool; + std::list stages[EShLangCount]; + TIntermediate* intermediate[EShLangCount]; + bool newedIntermediate[EShLangCount]; // track which intermediate were "new" versus reusing a singleton unit in a stage + TInfoSink* infoSink; + TReflection* reflection; + bool linked; + +private: + TProgram(TProgram&); + TProgram& operator=(TProgram&); +}; + +} // end namespace glslang + +#endif // _COMPILER_INTERFACE_INCLUDED_ diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/Public/resource_limits_c.h b/app/libs/ncnn/armeabi-v7a/include/glslang/Public/resource_limits_c.h new file mode 100644 index 0000000..4ad052b --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/Public/resource_limits_c.h @@ -0,0 +1,58 @@ +/** +BSD 2-Clause License + +Copyright (c) 2020, Travis Fort +All rights reserved. + +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. +**/ + +#ifndef _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ +#define _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ + +#include "../Include/glslang_c_interface.h" +#include "../Include/visibility.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Returns a struct that can be use to create custom resource values. +GLSLANG_EXPORT glslang_resource_t* glslang_resource(void); + +// These are the default resources for TBuiltInResources, used for both +// - parsing this string for the case where the user didn't supply one, +// - dumping out a template for user construction of a config file. +GLSLANG_EXPORT const glslang_resource_t* glslang_default_resource(void); + +// Returns the DefaultTBuiltInResource as a human-readable string. +// NOTE: User is responsible for freeing this string. +GLSLANG_EXPORT const char* glslang_default_resource_string(void); + +// Decodes the resource limits from |config| to |resources|. +GLSLANG_EXPORT void glslang_decode_resource_limits(glslang_resource_t* resources, char* config); + +#ifdef __cplusplus +} +#endif + +#endif // _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/GlslangToSpv.h b/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/GlslangToSpv.h new file mode 100644 index 0000000..9fb4f3f --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/GlslangToSpv.h @@ -0,0 +1,69 @@ +// +// Copyright (C) 2014 LunarG, Inc. +// Copyright (C) 2015-2018 Google, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. + +#pragma once + +#include +#include + +#include "Logger.h" +#include "glslang/Include/visibility.h" + +namespace glslang { +class TIntermediate; + +struct SpvOptions { + bool generateDebugInfo {false}; + bool stripDebugInfo {false}; + bool disableOptimizer {true}; + bool optimizeSize {false}; + bool disassemble {false}; + bool validate {false}; + bool emitNonSemanticShaderDebugInfo {false}; + bool emitNonSemanticShaderDebugSource{ false }; + bool compileOnly{false}; + bool optimizerAllowExpandedIDBound{false}; +}; + +GLSLANG_EXPORT void GetSpirvVersion(std::string&); +GLSLANG_EXPORT int GetSpirvGeneratorVersion(); +GLSLANG_EXPORT void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, + SpvOptions* options = nullptr); +GLSLANG_EXPORT void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger* logger, SpvOptions* options = nullptr); +GLSLANG_EXPORT bool OutputSpvBin(const std::vector& spirv, const char* baseName); +GLSLANG_EXPORT bool OutputSpvHex(const std::vector& spirv, const char* baseName, const char* varName); + +} diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/Logger.h b/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/Logger.h new file mode 100644 index 0000000..c64a3b8 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/Logger.h @@ -0,0 +1,75 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of Google Inc. 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 HOLDERS 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. + +#ifndef GLSLANG_SPIRV_LOGGER_H +#define GLSLANG_SPIRV_LOGGER_H + +#include +#include +#include "glslang/Include/visibility.h" + +namespace spv { + +// A class for holding all SPIR-V build status messages, including +// missing/TBD functionalities, warnings, and errors. +class GLSLANG_EXPORT SpvBuildLogger { +public: + SpvBuildLogger() {} + + // Registers a TBD functionality. + void tbdFunctionality(const std::string& f); + // Registers a missing functionality. + void missingFunctionality(const std::string& f); + + // Logs a warning. + void warning(const std::string& w) { warnings.push_back(w); } + // Logs an error. + void error(const std::string& e) { errors.push_back(e); } + + // Returns all messages accumulated in the order of: + // TBD functionalities, missing functionalities, warnings, errors. + std::string getAllMessages() const; + +private: + SpvBuildLogger(const SpvBuildLogger&); + + std::vector tbdFeatures; + std::vector missingFeatures; + std::vector warnings; + std::vector errors; +}; + +} // end spv namespace + +#endif // GLSLANG_SPIRV_LOGGER_H diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/SpvTools.h b/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/SpvTools.h new file mode 100644 index 0000000..4558572 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/SpvTools.h @@ -0,0 +1,109 @@ +// +// Copyright (C) 2014-2016 LunarG, Inc. +// Copyright (C) 2018 Google, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. + +// +// Call into SPIRV-Tools to disassemble, validate, and optimize. +// + +#pragma once +#ifndef GLSLANG_SPV_TOOLS_H +#define GLSLANG_SPV_TOOLS_H + +#if ENABLE_OPT +#include +#include +#include +#include "spirv-tools/libspirv.h" +#endif + +#include "glslang/MachineIndependent/Versions.h" +#include "glslang/Include/visibility.h" +#include "GlslangToSpv.h" +#include "Logger.h" + +namespace glslang { + +#if ENABLE_OPT + +class TIntermediate; + +// Translate glslang's view of target versioning to what SPIRV-Tools uses. +GLSLANG_EXPORT spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger); +GLSLANG_EXPORT spv_target_env MapToSpirvToolsEnv(const glslang::TIntermediate& intermediate, spv::SpvBuildLogger* logger); + +// Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment. +GLSLANG_EXPORT void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv); + +// Use the SPIRV-Tools disassembler to print SPIR-V with a provided SPIR-V environment. +GLSLANG_EXPORT void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv, + spv_target_env requested_context); + +// Apply the SPIRV-Tools validator to generated SPIR-V. +GLSLANG_EXPORT void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger*, bool prelegalization); + +// Apply the SPIRV-Tools optimizer to generated SPIR-V. HLSL SPIR-V is legalized in the process. +GLSLANG_EXPORT void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger*, const SpvOptions*); + +// Apply the SPIRV-Tools EliminateDeadInputComponents pass to generated SPIR-V. Put result in |spirv|. +GLSLANG_EXPORT void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector& spirv, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools AnalyzeDeadOutputStores pass to generated SPIR-V. Put result in |live_locs|. +// Return true if the result is valid. +GLSLANG_EXPORT bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools EliminateDeadOutputStores and AggressiveDeadCodeElimination passes to generated SPIR-V using +// |live_locs|. Put result in |spirv|. +GLSLANG_EXPORT void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector& spirv, + std::unordered_set* live_locs, + std::unordered_set* live_builtins, + spv::SpvBuildLogger*); + +// Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by +// SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if +// optimization is disabled. +GLSLANG_EXPORT void SpirvToolsStripDebugInfo(const glslang::TIntermediate& intermediate, + std::vector& spirv, spv::SpvBuildLogger*); + +#endif + +} // end namespace glslang + +#endif // GLSLANG_SPV_TOOLS_H diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/disassemble.h b/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/disassemble.h new file mode 100644 index 0000000..3bded14 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/disassemble.h @@ -0,0 +1,55 @@ +// +// Copyright (C) 2014-2015 LunarG, Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of 3Dlabs Inc. Ltd. 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 HOLDERS 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. + +// +// Disassembler for SPIR-V. +// + +#pragma once +#ifndef disassembler_H +#define disassembler_H + +#include +#include + +#include "glslang/Include/visibility.h" + +namespace spv { + + // disassemble with glslang custom disassembler + GLSLANG_EXPORT void Disassemble(std::ostream& out, const std::vector&); + +} // end namespace spv + +#endif // disassembler_H diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/spirv.hpp11 b/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/spirv.hpp11 new file mode 100644 index 0000000..7708834 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/SPIRV/spirv.hpp11 @@ -0,0 +1,5351 @@ +// Copyright (c) 2014-2024 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. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python, C#, D, Beef +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// - C# will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL +// - Beef will use enum classes in the Specification class located in the "Spv" namespace, +// e.g.: Spv.Specification.SourceLanguage.GLSL +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10600 +#define SPV_REVISION 1 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010600; +static const unsigned int Revision = 1; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum class SourceLanguage : unsigned { + Unknown = 0, + ESSL = 1, + GLSL = 2, + OpenCL_C = 3, + OpenCL_CPP = 4, + HLSL = 5, + CPP_for_OpenCL = 6, + SYCL = 7, + HERO_C = 8, + NZSL = 9, + WGSL = 10, + Slang = 11, + Zig = 12, + Rust = 13, + Max = 0x7fffffff, +}; + +enum class ExecutionModel : unsigned { + Vertex = 0, + TessellationControl = 1, + TessellationEvaluation = 2, + Geometry = 3, + Fragment = 4, + GLCompute = 5, + Kernel = 6, + TaskNV = 5267, + MeshNV = 5268, + RayGenerationKHR = 5313, + RayGenerationNV = 5313, + IntersectionKHR = 5314, + IntersectionNV = 5314, + AnyHitKHR = 5315, + AnyHitNV = 5315, + ClosestHitKHR = 5316, + ClosestHitNV = 5316, + MissKHR = 5317, + MissNV = 5317, + CallableKHR = 5318, + CallableNV = 5318, + TaskEXT = 5364, + MeshEXT = 5365, + Max = 0x7fffffff, +}; + +enum class AddressingModel : unsigned { + Logical = 0, + Physical32 = 1, + Physical64 = 2, + PhysicalStorageBuffer64 = 5348, + PhysicalStorageBuffer64EXT = 5348, + Max = 0x7fffffff, +}; + +enum class MemoryModel : unsigned { + Simple = 0, + GLSL450 = 1, + OpenCL = 2, + Vulkan = 3, + VulkanKHR = 3, + Max = 0x7fffffff, +}; + +enum class ExecutionMode : unsigned { + Invocations = 0, + SpacingEqual = 1, + SpacingFractionalEven = 2, + SpacingFractionalOdd = 3, + VertexOrderCw = 4, + VertexOrderCcw = 5, + PixelCenterInteger = 6, + OriginUpperLeft = 7, + OriginLowerLeft = 8, + EarlyFragmentTests = 9, + PointMode = 10, + Xfb = 11, + DepthReplacing = 12, + DepthGreater = 14, + DepthLess = 15, + DepthUnchanged = 16, + LocalSize = 17, + LocalSizeHint = 18, + InputPoints = 19, + InputLines = 20, + InputLinesAdjacency = 21, + Triangles = 22, + InputTrianglesAdjacency = 23, + Quads = 24, + Isolines = 25, + OutputVertices = 26, + OutputPoints = 27, + OutputLineStrip = 28, + OutputTriangleStrip = 29, + VecTypeHint = 30, + ContractionOff = 31, + Initializer = 33, + Finalizer = 34, + SubgroupSize = 35, + SubgroupsPerWorkgroup = 36, + SubgroupsPerWorkgroupId = 37, + LocalSizeId = 38, + LocalSizeHintId = 39, + NonCoherentColorAttachmentReadEXT = 4169, + NonCoherentDepthAttachmentReadEXT = 4170, + NonCoherentStencilAttachmentReadEXT = 4171, + SubgroupUniformControlFlowKHR = 4421, + PostDepthCoverage = 4446, + DenormPreserve = 4459, + DenormFlushToZero = 4460, + SignedZeroInfNanPreserve = 4461, + RoundingModeRTE = 4462, + RoundingModeRTZ = 4463, + NonCoherentTileAttachmentReadQCOM = 4489, + TileShadingRateQCOM = 4490, + EarlyAndLateFragmentTestsAMD = 5017, + StencilRefReplacingEXT = 5027, + CoalescingAMDX = 5069, + IsApiEntryAMDX = 5070, + MaxNodeRecursionAMDX = 5071, + StaticNumWorkgroupsAMDX = 5072, + ShaderIndexAMDX = 5073, + MaxNumWorkgroupsAMDX = 5077, + StencilRefUnchangedFrontAMD = 5079, + StencilRefGreaterFrontAMD = 5080, + StencilRefLessFrontAMD = 5081, + StencilRefUnchangedBackAMD = 5082, + StencilRefGreaterBackAMD = 5083, + StencilRefLessBackAMD = 5084, + QuadDerivativesKHR = 5088, + RequireFullQuadsKHR = 5089, + SharesInputWithAMDX = 5102, + OutputLinesEXT = 5269, + OutputLinesNV = 5269, + OutputPrimitivesEXT = 5270, + OutputPrimitivesNV = 5270, + DerivativeGroupQuadsKHR = 5289, + DerivativeGroupQuadsNV = 5289, + DerivativeGroupLinearKHR = 5290, + DerivativeGroupLinearNV = 5290, + OutputTrianglesEXT = 5298, + OutputTrianglesNV = 5298, + PixelInterlockOrderedEXT = 5366, + PixelInterlockUnorderedEXT = 5367, + SampleInterlockOrderedEXT = 5368, + SampleInterlockUnorderedEXT = 5369, + ShadingRateInterlockOrderedEXT = 5370, + ShadingRateInterlockUnorderedEXT = 5371, + Shader64BitIndexingEXT = 5427, + SharedLocalMemorySizeINTEL = 5618, + RoundingModeRTPINTEL = 5620, + RoundingModeRTNINTEL = 5621, + FloatingPointModeALTINTEL = 5622, + FloatingPointModeIEEEINTEL = 5623, + MaxWorkgroupSizeINTEL = 5893, + MaxWorkDimINTEL = 5894, + NoGlobalOffsetINTEL = 5895, + NumSIMDWorkitemsINTEL = 5896, + SchedulerTargetFmaxMhzINTEL = 5903, + MaximallyReconvergesKHR = 6023, + FPFastMathDefault = 6028, + StreamingInterfaceINTEL = 6154, + RegisterMapInterfaceINTEL = 6160, + NamedBarrierCountINTEL = 6417, + MaximumRegistersINTEL = 6461, + MaximumRegistersIdINTEL = 6462, + NamedMaximumRegistersINTEL = 6463, + Max = 0x7fffffff, +}; + +enum class StorageClass : unsigned { + UniformConstant = 0, + Input = 1, + Uniform = 2, + Output = 3, + Workgroup = 4, + CrossWorkgroup = 5, + Private = 6, + Function = 7, + Generic = 8, + PushConstant = 9, + AtomicCounter = 10, + Image = 11, + StorageBuffer = 12, + TileImageEXT = 4172, + TileAttachmentQCOM = 4491, + NodePayloadAMDX = 5068, + CallableDataKHR = 5328, + CallableDataNV = 5328, + IncomingCallableDataKHR = 5329, + IncomingCallableDataNV = 5329, + RayPayloadKHR = 5338, + RayPayloadNV = 5338, + HitAttributeKHR = 5339, + HitAttributeNV = 5339, + IncomingRayPayloadKHR = 5342, + IncomingRayPayloadNV = 5342, + ShaderRecordBufferKHR = 5343, + ShaderRecordBufferNV = 5343, + PhysicalStorageBuffer = 5349, + PhysicalStorageBufferEXT = 5349, + HitObjectAttributeNV = 5385, + TaskPayloadWorkgroupEXT = 5402, + HitObjectAttributeEXT = 5411, + CodeSectionINTEL = 5605, + DeviceOnlyINTEL = 5936, + HostOnlyINTEL = 5937, + Max = 0x7fffffff, +}; + +enum class Dim : unsigned { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + Cube = 3, + Rect = 4, + Buffer = 5, + SubpassData = 6, + TileImageDataEXT = 4173, + Max = 0x7fffffff, +}; + +enum class SamplerAddressingMode : unsigned { + None = 0, + ClampToEdge = 1, + Clamp = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class SamplerFilterMode : unsigned { + Nearest = 0, + Linear = 1, + Max = 0x7fffffff, +}; + +enum class ImageFormat : unsigned { + Unknown = 0, + Rgba32f = 1, + Rgba16f = 2, + R32f = 3, + Rgba8 = 4, + Rgba8Snorm = 5, + Rg32f = 6, + Rg16f = 7, + R11fG11fB10f = 8, + R16f = 9, + Rgba16 = 10, + Rgb10A2 = 11, + Rg16 = 12, + Rg8 = 13, + R16 = 14, + R8 = 15, + Rgba16Snorm = 16, + Rg16Snorm = 17, + Rg8Snorm = 18, + R16Snorm = 19, + R8Snorm = 20, + Rgba32i = 21, + Rgba16i = 22, + Rgba8i = 23, + R32i = 24, + Rg32i = 25, + Rg16i = 26, + Rg8i = 27, + R16i = 28, + R8i = 29, + Rgba32ui = 30, + Rgba16ui = 31, + Rgba8ui = 32, + R32ui = 33, + Rgb10a2ui = 34, + Rg32ui = 35, + Rg16ui = 36, + Rg8ui = 37, + R16ui = 38, + R8ui = 39, + R64ui = 40, + R64i = 41, + Max = 0x7fffffff, +}; + +enum class ImageChannelOrder : unsigned { + R = 0, + A = 1, + RG = 2, + RA = 3, + RGB = 4, + RGBA = 5, + BGRA = 6, + ARGB = 7, + Intensity = 8, + Luminance = 9, + Rx = 10, + RGx = 11, + RGBx = 12, + Depth = 13, + DepthStencil = 14, + sRGB = 15, + sRGBx = 16, + sRGBA = 17, + sBGRA = 18, + ABGR = 19, + Max = 0x7fffffff, +}; + +enum class ImageChannelDataType : unsigned { + SnormInt8 = 0, + SnormInt16 = 1, + UnormInt8 = 2, + UnormInt16 = 3, + UnormShort565 = 4, + UnormShort555 = 5, + UnormInt101010 = 6, + SignedInt8 = 7, + SignedInt16 = 8, + SignedInt32 = 9, + UnsignedInt8 = 10, + UnsignedInt16 = 11, + UnsignedInt32 = 12, + HalfFloat = 13, + Float = 14, + UnormInt24 = 15, + UnormInt101010_2 = 16, + UnsignedIntRaw10EXT = 19, + UnsignedIntRaw12EXT = 20, + UnormInt2_101010EXT = 21, + Max = 0x7fffffff, +}; + +enum class ImageOperandsShift : unsigned { + Bias = 0, + Lod = 1, + Grad = 2, + ConstOffset = 3, + Offset = 4, + ConstOffsets = 5, + Sample = 6, + MinLod = 7, + MakeTexelAvailable = 8, + MakeTexelAvailableKHR = 8, + MakeTexelVisible = 9, + MakeTexelVisibleKHR = 9, + NonPrivateTexel = 10, + NonPrivateTexelKHR = 10, + VolatileTexel = 11, + VolatileTexelKHR = 11, + SignExtend = 12, + ZeroExtend = 13, + Nontemporal = 14, + Offsets = 16, + Max = 0x7fffffff, +}; + +enum class ImageOperandsMask : unsigned { + MaskNone = 0, + Bias = 0x00000001, + Lod = 0x00000002, + Grad = 0x00000004, + ConstOffset = 0x00000008, + Offset = 0x00000010, + ConstOffsets = 0x00000020, + Sample = 0x00000040, + MinLod = 0x00000080, + MakeTexelAvailable = 0x00000100, + MakeTexelAvailableKHR = 0x00000100, + MakeTexelVisible = 0x00000200, + MakeTexelVisibleKHR = 0x00000200, + NonPrivateTexel = 0x00000400, + NonPrivateTexelKHR = 0x00000400, + VolatileTexel = 0x00000800, + VolatileTexelKHR = 0x00000800, + SignExtend = 0x00001000, + ZeroExtend = 0x00002000, + Nontemporal = 0x00004000, + Offsets = 0x00010000, +}; + +enum class FPFastMathModeShift : unsigned { + NotNaN = 0, + NotInf = 1, + NSZ = 2, + AllowRecip = 3, + Fast = 4, + AllowContract = 16, + AllowContractFastINTEL = 16, + AllowReassoc = 17, + AllowReassocINTEL = 17, + AllowTransform = 18, + Max = 0x7fffffff, +}; + +enum class FPFastMathModeMask : unsigned { + MaskNone = 0, + NotNaN = 0x00000001, + NotInf = 0x00000002, + NSZ = 0x00000004, + AllowRecip = 0x00000008, + Fast = 0x00000010, + AllowContract = 0x00010000, + AllowContractFastINTEL = 0x00010000, + AllowReassoc = 0x00020000, + AllowReassocINTEL = 0x00020000, + AllowTransform = 0x00040000, +}; + +enum class FPRoundingMode : unsigned { + RTE = 0, + RTZ = 1, + RTP = 2, + RTN = 3, + Max = 0x7fffffff, +}; + +enum class LinkageType : unsigned { + Export = 0, + Import = 1, + LinkOnceODR = 2, + Max = 0x7fffffff, +}; + +enum class AccessQualifier : unsigned { + ReadOnly = 0, + WriteOnly = 1, + ReadWrite = 2, + Max = 0x7fffffff, +}; + +enum class FunctionParameterAttribute : unsigned { + Zext = 0, + Sext = 1, + ByVal = 2, + Sret = 3, + NoAlias = 4, + NoCapture = 5, + NoWrite = 6, + NoReadWrite = 7, + RuntimeAlignedINTEL = 5940, + Max = 0x7fffffff, +}; + +enum class Decoration : unsigned { + RelaxedPrecision = 0, + SpecId = 1, + Block = 2, + BufferBlock = 3, + RowMajor = 4, + ColMajor = 5, + ArrayStride = 6, + MatrixStride = 7, + GLSLShared = 8, + GLSLPacked = 9, + CPacked = 10, + BuiltIn = 11, + NoPerspective = 13, + Flat = 14, + Patch = 15, + Centroid = 16, + Sample = 17, + Invariant = 18, + Restrict = 19, + Aliased = 20, + Volatile = 21, + Constant = 22, + Coherent = 23, + NonWritable = 24, + NonReadable = 25, + Uniform = 26, + UniformId = 27, + SaturatedConversion = 28, + Stream = 29, + Location = 30, + Component = 31, + Index = 32, + Binding = 33, + DescriptorSet = 34, + Offset = 35, + XfbBuffer = 36, + XfbStride = 37, + FuncParamAttr = 38, + FPRoundingMode = 39, + FPFastMathMode = 40, + LinkageAttributes = 41, + NoContraction = 42, + InputAttachmentIndex = 43, + Alignment = 44, + MaxByteOffset = 45, + AlignmentId = 46, + MaxByteOffsetId = 47, + SaturatedToLargestFloat8NormalConversionEXT = 4216, + NoSignedWrap = 4469, + NoUnsignedWrap = 4470, + WeightTextureQCOM = 4487, + BlockMatchTextureQCOM = 4488, + BlockMatchSamplerQCOM = 4499, + ExplicitInterpAMD = 4999, + NodeSharesPayloadLimitsWithAMDX = 5019, + NodeMaxPayloadsAMDX = 5020, + TrackFinishWritingAMDX = 5078, + PayloadNodeNameAMDX = 5091, + PayloadNodeBaseIndexAMDX = 5098, + PayloadNodeSparseArrayAMDX = 5099, + PayloadNodeArraySizeAMDX = 5100, + PayloadDispatchIndirectAMDX = 5105, + OverrideCoverageNV = 5248, + PassthroughNV = 5250, + ViewportRelativeNV = 5252, + SecondaryViewportRelativeNV = 5256, + PerPrimitiveEXT = 5271, + PerPrimitiveNV = 5271, + PerViewNV = 5272, + PerTaskNV = 5273, + PerVertexKHR = 5285, + PerVertexNV = 5285, + NonUniform = 5300, + NonUniformEXT = 5300, + RestrictPointer = 5355, + RestrictPointerEXT = 5355, + AliasedPointer = 5356, + AliasedPointerEXT = 5356, + HitObjectShaderRecordBufferNV = 5386, + HitObjectShaderRecordBufferEXT = 5389, + BindlessSamplerNV = 5398, + BindlessImageNV = 5399, + BoundSamplerNV = 5400, + BoundImageNV = 5401, + SIMTCallINTEL = 5599, + ReferencedIndirectlyINTEL = 5602, + ClobberINTEL = 5607, + SideEffectsINTEL = 5608, + VectorComputeVariableINTEL = 5624, + FuncParamIOKindINTEL = 5625, + VectorComputeFunctionINTEL = 5626, + StackCallINTEL = 5627, + GlobalVariableOffsetINTEL = 5628, + CounterBuffer = 5634, + HlslCounterBufferGOOGLE = 5634, + HlslSemanticGOOGLE = 5635, + UserSemantic = 5635, + UserTypeGOOGLE = 5636, + FunctionRoundingModeINTEL = 5822, + FunctionDenormModeINTEL = 5823, + RegisterINTEL = 5825, + MemoryINTEL = 5826, + NumbanksINTEL = 5827, + BankwidthINTEL = 5828, + MaxPrivateCopiesINTEL = 5829, + SinglepumpINTEL = 5830, + DoublepumpINTEL = 5831, + MaxReplicatesINTEL = 5832, + SimpleDualPortINTEL = 5833, + MergeINTEL = 5834, + BankBitsINTEL = 5835, + ForcePow2DepthINTEL = 5836, + StridesizeINTEL = 5883, + WordsizeINTEL = 5884, + TrueDualPortINTEL = 5885, + BurstCoalesceINTEL = 5899, + CacheSizeINTEL = 5900, + DontStaticallyCoalesceINTEL = 5901, + PrefetchINTEL = 5902, + StallEnableINTEL = 5905, + FuseLoopsInFunctionINTEL = 5907, + MathOpDSPModeINTEL = 5909, + AliasScopeINTEL = 5914, + NoAliasINTEL = 5915, + InitiationIntervalINTEL = 5917, + MaxConcurrencyINTEL = 5918, + PipelineEnableINTEL = 5919, + BufferLocationINTEL = 5921, + IOPipeStorageINTEL = 5944, + FunctionFloatingPointModeINTEL = 6080, + SingleElementVectorINTEL = 6085, + VectorComputeCallableFunctionINTEL = 6087, + MediaBlockIOINTEL = 6140, + StallFreeINTEL = 6151, + FPMaxErrorDecorationINTEL = 6170, + LatencyControlLabelINTEL = 6172, + LatencyControlConstraintINTEL = 6173, + ConduitKernelArgumentINTEL = 6175, + RegisterMapKernelArgumentINTEL = 6176, + MMHostInterfaceAddressWidthINTEL = 6177, + MMHostInterfaceDataWidthINTEL = 6178, + MMHostInterfaceLatencyINTEL = 6179, + MMHostInterfaceReadWriteModeINTEL = 6180, + MMHostInterfaceMaxBurstINTEL = 6181, + MMHostInterfaceWaitRequestINTEL = 6182, + StableKernelArgumentINTEL = 6183, + HostAccessINTEL = 6188, + InitModeINTEL = 6190, + ImplementInRegisterMapINTEL = 6191, + CacheControlLoadINTEL = 6442, + CacheControlStoreINTEL = 6443, + Max = 0x7fffffff, +}; + +enum class BuiltIn : unsigned { + Position = 0, + PointSize = 1, + ClipDistance = 3, + CullDistance = 4, + VertexId = 5, + InstanceId = 6, + PrimitiveId = 7, + InvocationId = 8, + Layer = 9, + ViewportIndex = 10, + TessLevelOuter = 11, + TessLevelInner = 12, + TessCoord = 13, + PatchVertices = 14, + FragCoord = 15, + PointCoord = 16, + FrontFacing = 17, + SampleId = 18, + SamplePosition = 19, + SampleMask = 20, + FragDepth = 22, + HelperInvocation = 23, + NumWorkgroups = 24, + WorkgroupSize = 25, + WorkgroupId = 26, + LocalInvocationId = 27, + GlobalInvocationId = 28, + LocalInvocationIndex = 29, + WorkDim = 30, + GlobalSize = 31, + EnqueuedWorkgroupSize = 32, + GlobalOffset = 33, + GlobalLinearId = 34, + SubgroupSize = 36, + SubgroupMaxSize = 37, + NumSubgroups = 38, + NumEnqueuedSubgroups = 39, + SubgroupId = 40, + SubgroupLocalInvocationId = 41, + VertexIndex = 42, + InstanceIndex = 43, + CoreIDARM = 4160, + CoreCountARM = 4161, + CoreMaxIDARM = 4162, + WarpIDARM = 4163, + WarpMaxIDARM = 4164, + SubgroupEqMask = 4416, + SubgroupEqMaskKHR = 4416, + SubgroupGeMask = 4417, + SubgroupGeMaskKHR = 4417, + SubgroupGtMask = 4418, + SubgroupGtMaskKHR = 4418, + SubgroupLeMask = 4419, + SubgroupLeMaskKHR = 4419, + SubgroupLtMask = 4420, + SubgroupLtMaskKHR = 4420, + BaseVertex = 4424, + BaseInstance = 4425, + DrawIndex = 4426, + PrimitiveShadingRateKHR = 4432, + DeviceIndex = 4438, + ViewIndex = 4440, + ShadingRateKHR = 4444, + TileOffsetQCOM = 4492, + TileDimensionQCOM = 4493, + TileApronSizeQCOM = 4494, + BaryCoordNoPerspAMD = 4992, + BaryCoordNoPerspCentroidAMD = 4993, + BaryCoordNoPerspSampleAMD = 4994, + BaryCoordSmoothAMD = 4995, + BaryCoordSmoothCentroidAMD = 4996, + BaryCoordSmoothSampleAMD = 4997, + BaryCoordPullModelAMD = 4998, + FragStencilRefEXT = 5014, + RemainingRecursionLevelsAMDX = 5021, + ShaderIndexAMDX = 5073, + ViewportMaskNV = 5253, + SecondaryPositionNV = 5257, + SecondaryViewportMaskNV = 5258, + PositionPerViewNV = 5261, + ViewportMaskPerViewNV = 5262, + FullyCoveredEXT = 5264, + TaskCountNV = 5274, + PrimitiveCountNV = 5275, + PrimitiveIndicesNV = 5276, + ClipDistancePerViewNV = 5277, + CullDistancePerViewNV = 5278, + LayerPerViewNV = 5279, + MeshViewCountNV = 5280, + MeshViewIndicesNV = 5281, + BaryCoordKHR = 5286, + BaryCoordNV = 5286, + BaryCoordNoPerspKHR = 5287, + BaryCoordNoPerspNV = 5287, + FragSizeEXT = 5292, + FragmentSizeNV = 5292, + FragInvocationCountEXT = 5293, + InvocationsPerPixelNV = 5293, + PrimitivePointIndicesEXT = 5294, + PrimitiveLineIndicesEXT = 5295, + PrimitiveTriangleIndicesEXT = 5296, + CullPrimitiveEXT = 5299, + LaunchIdKHR = 5319, + LaunchIdNV = 5319, + LaunchSizeKHR = 5320, + LaunchSizeNV = 5320, + WorldRayOriginKHR = 5321, + WorldRayOriginNV = 5321, + WorldRayDirectionKHR = 5322, + WorldRayDirectionNV = 5322, + ObjectRayOriginKHR = 5323, + ObjectRayOriginNV = 5323, + ObjectRayDirectionKHR = 5324, + ObjectRayDirectionNV = 5324, + RayTminKHR = 5325, + RayTminNV = 5325, + RayTmaxKHR = 5326, + RayTmaxNV = 5326, + InstanceCustomIndexKHR = 5327, + InstanceCustomIndexNV = 5327, + ObjectToWorldKHR = 5330, + ObjectToWorldNV = 5330, + WorldToObjectKHR = 5331, + WorldToObjectNV = 5331, + HitTNV = 5332, + HitKindKHR = 5333, + HitKindNV = 5333, + CurrentRayTimeNV = 5334, + HitTriangleVertexPositionsKHR = 5335, + HitMicroTriangleVertexPositionsNV = 5337, + HitMicroTriangleVertexBarycentricsNV = 5344, + IncomingRayFlagsKHR = 5351, + IncomingRayFlagsNV = 5351, + RayGeometryIndexKHR = 5352, + HitIsSphereNV = 5359, + HitIsLSSNV = 5360, + HitSpherePositionNV = 5361, + WarpsPerSMNV = 5374, + SMCountNV = 5375, + WarpIDNV = 5376, + SMIDNV = 5377, + HitLSSPositionsNV = 5396, + HitKindFrontFacingMicroTriangleNV = 5405, + HitKindBackFacingMicroTriangleNV = 5406, + HitSphereRadiusNV = 5420, + HitLSSRadiiNV = 5421, + ClusterIDNV = 5436, + CullMaskKHR = 6021, + Max = 0x7fffffff, +}; + +enum class SelectionControlShift : unsigned { + Flatten = 0, + DontFlatten = 1, + Max = 0x7fffffff, +}; + +enum class SelectionControlMask : unsigned { + MaskNone = 0, + Flatten = 0x00000001, + DontFlatten = 0x00000002, +}; + +enum class LoopControlShift : unsigned { + Unroll = 0, + DontUnroll = 1, + DependencyInfinite = 2, + DependencyLength = 3, + MinIterations = 4, + MaxIterations = 5, + IterationMultiple = 6, + PeelCount = 7, + PartialCount = 8, + InitiationIntervalINTEL = 16, + MaxConcurrencyINTEL = 17, + DependencyArrayINTEL = 18, + PipelineEnableINTEL = 19, + LoopCoalesceINTEL = 20, + MaxInterleavingINTEL = 21, + SpeculatedIterationsINTEL = 22, + NoFusionINTEL = 23, + LoopCountINTEL = 24, + MaxReinvocationDelayINTEL = 25, + Max = 0x7fffffff, +}; + +enum class LoopControlMask : unsigned { + MaskNone = 0, + Unroll = 0x00000001, + DontUnroll = 0x00000002, + DependencyInfinite = 0x00000004, + DependencyLength = 0x00000008, + MinIterations = 0x00000010, + MaxIterations = 0x00000020, + IterationMultiple = 0x00000040, + PeelCount = 0x00000080, + PartialCount = 0x00000100, + InitiationIntervalINTEL = 0x00010000, + MaxConcurrencyINTEL = 0x00020000, + DependencyArrayINTEL = 0x00040000, + PipelineEnableINTEL = 0x00080000, + LoopCoalesceINTEL = 0x00100000, + MaxInterleavingINTEL = 0x00200000, + SpeculatedIterationsINTEL = 0x00400000, + NoFusionINTEL = 0x00800000, + LoopCountINTEL = 0x01000000, + MaxReinvocationDelayINTEL = 0x02000000, +}; + +enum class FunctionControlShift : unsigned { + Inline = 0, + DontInline = 1, + Pure = 2, + Const = 3, + OptNoneEXT = 16, + OptNoneINTEL = 16, + Max = 0x7fffffff, +}; + +enum class FunctionControlMask : unsigned { + MaskNone = 0, + Inline = 0x00000001, + DontInline = 0x00000002, + Pure = 0x00000004, + Const = 0x00000008, + OptNoneEXT = 0x00010000, + OptNoneINTEL = 0x00010000, +}; + +enum class MemorySemanticsShift : unsigned { + Acquire = 1, + Release = 2, + AcquireRelease = 3, + SequentiallyConsistent = 4, + UniformMemory = 6, + SubgroupMemory = 7, + WorkgroupMemory = 8, + CrossWorkgroupMemory = 9, + AtomicCounterMemory = 10, + ImageMemory = 11, + OutputMemory = 12, + OutputMemoryKHR = 12, + MakeAvailable = 13, + MakeAvailableKHR = 13, + MakeVisible = 14, + MakeVisibleKHR = 14, + Volatile = 15, + Max = 0x7fffffff, +}; + +enum class MemorySemanticsMask : unsigned { + MaskNone = 0, + Acquire = 0x00000002, + Release = 0x00000004, + AcquireRelease = 0x00000008, + SequentiallyConsistent = 0x00000010, + UniformMemory = 0x00000040, + SubgroupMemory = 0x00000080, + WorkgroupMemory = 0x00000100, + CrossWorkgroupMemory = 0x00000200, + AtomicCounterMemory = 0x00000400, + ImageMemory = 0x00000800, + OutputMemory = 0x00001000, + OutputMemoryKHR = 0x00001000, + MakeAvailable = 0x00002000, + MakeAvailableKHR = 0x00002000, + MakeVisible = 0x00004000, + MakeVisibleKHR = 0x00004000, + Volatile = 0x00008000, +}; + +enum class MemoryAccessShift : unsigned { + Volatile = 0, + Aligned = 1, + Nontemporal = 2, + MakePointerAvailable = 3, + MakePointerAvailableKHR = 3, + MakePointerVisible = 4, + MakePointerVisibleKHR = 4, + NonPrivatePointer = 5, + NonPrivatePointerKHR = 5, + AliasScopeINTELMask = 16, + NoAliasINTELMask = 17, + Max = 0x7fffffff, +}; + +enum class MemoryAccessMask : unsigned { + MaskNone = 0, + Volatile = 0x00000001, + Aligned = 0x00000002, + Nontemporal = 0x00000004, + MakePointerAvailable = 0x00000008, + MakePointerAvailableKHR = 0x00000008, + MakePointerVisible = 0x00000010, + MakePointerVisibleKHR = 0x00000010, + NonPrivatePointer = 0x00000020, + NonPrivatePointerKHR = 0x00000020, + AliasScopeINTELMask = 0x00010000, + NoAliasINTELMask = 0x00020000, +}; + +enum class Scope : unsigned { + CrossDevice = 0, + Device = 1, + Workgroup = 2, + Subgroup = 3, + Invocation = 4, + QueueFamily = 5, + QueueFamilyKHR = 5, + ShaderCallKHR = 6, + Max = 0x7fffffff, +}; + +enum class GroupOperation : unsigned { + Reduce = 0, + InclusiveScan = 1, + ExclusiveScan = 2, + ClusteredReduce = 3, + PartitionedReduceNV = 6, + PartitionedInclusiveScanNV = 7, + PartitionedExclusiveScanNV = 8, + Max = 0x7fffffff, +}; + +enum class KernelEnqueueFlags : unsigned { + NoWait = 0, + WaitKernel = 1, + WaitWorkGroup = 2, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoShift : unsigned { + CmdExecTime = 0, + Max = 0x7fffffff, +}; + +enum class KernelProfilingInfoMask : unsigned { + MaskNone = 0, + CmdExecTime = 0x00000001, +}; + +enum class Capability : unsigned { + Matrix = 0, + Shader = 1, + Geometry = 2, + Tessellation = 3, + Addresses = 4, + Linkage = 5, + Kernel = 6, + Vector16 = 7, + Float16Buffer = 8, + Float16 = 9, + Float64 = 10, + Int64 = 11, + Int64Atomics = 12, + ImageBasic = 13, + ImageReadWrite = 14, + ImageMipmap = 15, + Pipes = 17, + Groups = 18, + DeviceEnqueue = 19, + LiteralSampler = 20, + AtomicStorage = 21, + Int16 = 22, + TessellationPointSize = 23, + GeometryPointSize = 24, + ImageGatherExtended = 25, + StorageImageMultisample = 27, + UniformBufferArrayDynamicIndexing = 28, + SampledImageArrayDynamicIndexing = 29, + StorageBufferArrayDynamicIndexing = 30, + StorageImageArrayDynamicIndexing = 31, + ClipDistance = 32, + CullDistance = 33, + ImageCubeArray = 34, + SampleRateShading = 35, + ImageRect = 36, + SampledRect = 37, + GenericPointer = 38, + Int8 = 39, + InputAttachment = 40, + SparseResidency = 41, + MinLod = 42, + Sampled1D = 43, + Image1D = 44, + SampledCubeArray = 45, + SampledBuffer = 46, + ImageBuffer = 47, + ImageMSArray = 48, + StorageImageExtendedFormats = 49, + ImageQuery = 50, + DerivativeControl = 51, + InterpolationFunction = 52, + TransformFeedback = 53, + GeometryStreams = 54, + StorageImageReadWithoutFormat = 55, + StorageImageWriteWithoutFormat = 56, + MultiViewport = 57, + SubgroupDispatch = 58, + NamedBarrier = 59, + PipeStorage = 60, + GroupNonUniform = 61, + GroupNonUniformVote = 62, + GroupNonUniformArithmetic = 63, + GroupNonUniformBallot = 64, + GroupNonUniformShuffle = 65, + GroupNonUniformShuffleRelative = 66, + GroupNonUniformClustered = 67, + GroupNonUniformQuad = 68, + ShaderLayer = 69, + ShaderViewportIndex = 70, + UniformDecoration = 71, + CoreBuiltinsARM = 4165, + TileImageColorReadAccessEXT = 4166, + TileImageDepthReadAccessEXT = 4167, + TileImageStencilReadAccessEXT = 4168, + TensorsARM = 4174, + CooperativeMatrixLayoutsARM = 4201, + Float8EXT = 4212, + Float8CooperativeMatrixEXT = 4213, + FragmentShadingRateKHR = 4422, + SubgroupBallotKHR = 4423, + DrawParameters = 4427, + WorkgroupMemoryExplicitLayoutKHR = 4428, + WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429, + WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430, + SubgroupVoteKHR = 4431, + StorageBuffer16BitAccess = 4433, + StorageUniformBufferBlock16 = 4433, + StorageUniform16 = 4434, + UniformAndStorageBuffer16BitAccess = 4434, + StoragePushConstant16 = 4435, + StorageInputOutput16 = 4436, + DeviceGroup = 4437, + MultiView = 4439, + VariablePointersStorageBuffer = 4441, + VariablePointers = 4442, + AtomicStorageOps = 4445, + SampleMaskPostDepthCoverage = 4447, + StorageBuffer8BitAccess = 4448, + UniformAndStorageBuffer8BitAccess = 4449, + StoragePushConstant8 = 4450, + DenormPreserve = 4464, + DenormFlushToZero = 4465, + SignedZeroInfNanPreserve = 4466, + RoundingModeRTE = 4467, + RoundingModeRTZ = 4468, + RayQueryProvisionalKHR = 4471, + RayQueryKHR = 4472, + UntypedPointersKHR = 4473, + RayTraversalPrimitiveCullingKHR = 4478, + RayTracingKHR = 4479, + TextureSampleWeightedQCOM = 4484, + TextureBoxFilterQCOM = 4485, + TextureBlockMatchQCOM = 4486, + TileShadingQCOM = 4495, + CooperativeMatrixConversionQCOM = 4496, + TextureBlockMatch2QCOM = 4498, + Float16ImageAMD = 5008, + ImageGatherBiasLodAMD = 5009, + FragmentMaskAMD = 5010, + StencilExportEXT = 5013, + ImageReadWriteLodAMD = 5015, + Int64ImageEXT = 5016, + ShaderClockKHR = 5055, + ShaderEnqueueAMDX = 5067, + QuadControlKHR = 5087, + BFloat16TypeKHR = 5116, + BFloat16DotProductKHR = 5117, + BFloat16CooperativeMatrixKHR = 5118, + SampleMaskOverrideCoverageNV = 5249, + GeometryShaderPassthroughNV = 5251, + ShaderViewportIndexLayerEXT = 5254, + ShaderViewportIndexLayerNV = 5254, + ShaderViewportMaskNV = 5255, + ShaderStereoViewNV = 5259, + PerViewAttributesNV = 5260, + FragmentFullyCoveredEXT = 5265, + MeshShadingNV = 5266, + ImageFootprintNV = 5282, + MeshShadingEXT = 5283, + FragmentBarycentricKHR = 5284, + FragmentBarycentricNV = 5284, + ComputeDerivativeGroupQuadsKHR = 5288, + ComputeDerivativeGroupQuadsNV = 5288, + FragmentDensityEXT = 5291, + ShadingRateNV = 5291, + GroupNonUniformPartitionedNV = 5297, + ShaderNonUniform = 5301, + ShaderNonUniformEXT = 5301, + RuntimeDescriptorArray = 5302, + RuntimeDescriptorArrayEXT = 5302, + InputAttachmentArrayDynamicIndexing = 5303, + InputAttachmentArrayDynamicIndexingEXT = 5303, + UniformTexelBufferArrayDynamicIndexing = 5304, + UniformTexelBufferArrayDynamicIndexingEXT = 5304, + StorageTexelBufferArrayDynamicIndexing = 5305, + StorageTexelBufferArrayDynamicIndexingEXT = 5305, + UniformBufferArrayNonUniformIndexing = 5306, + UniformBufferArrayNonUniformIndexingEXT = 5306, + SampledImageArrayNonUniformIndexing = 5307, + SampledImageArrayNonUniformIndexingEXT = 5307, + StorageBufferArrayNonUniformIndexing = 5308, + StorageBufferArrayNonUniformIndexingEXT = 5308, + StorageImageArrayNonUniformIndexing = 5309, + StorageImageArrayNonUniformIndexingEXT = 5309, + InputAttachmentArrayNonUniformIndexing = 5310, + InputAttachmentArrayNonUniformIndexingEXT = 5310, + UniformTexelBufferArrayNonUniformIndexing = 5311, + UniformTexelBufferArrayNonUniformIndexingEXT = 5311, + StorageTexelBufferArrayNonUniformIndexing = 5312, + StorageTexelBufferArrayNonUniformIndexingEXT = 5312, + RayTracingPositionFetchKHR = 5336, + RayTracingNV = 5340, + RayTracingMotionBlurNV = 5341, + VulkanMemoryModel = 5345, + VulkanMemoryModelKHR = 5345, + VulkanMemoryModelDeviceScope = 5346, + VulkanMemoryModelDeviceScopeKHR = 5346, + PhysicalStorageBufferAddresses = 5347, + PhysicalStorageBufferAddressesEXT = 5347, + ComputeDerivativeGroupLinearKHR = 5350, + ComputeDerivativeGroupLinearNV = 5350, + RayTracingProvisionalKHR = 5353, + CooperativeMatrixNV = 5357, + FragmentShaderSampleInterlockEXT = 5363, + FragmentShaderShadingRateInterlockEXT = 5372, + ShaderSMBuiltinsNV = 5373, + FragmentShaderPixelInterlockEXT = 5378, + DemoteToHelperInvocation = 5379, + DemoteToHelperInvocationEXT = 5379, + DisplacementMicromapNV = 5380, + RayTracingOpacityMicromapEXT = 5381, + ShaderInvocationReorderNV = 5383, + ShaderInvocationReorderEXT = 5388, + BindlessTextureNV = 5390, + RayQueryPositionFetchKHR = 5391, + CooperativeVectorNV = 5394, + AtomicFloat16VectorNV = 5404, + RayTracingDisplacementMicromapNV = 5409, + RawAccessChainsNV = 5414, + RayTracingSpheresGeometryNV = 5418, + RayTracingLinearSweptSpheresGeometryNV = 5419, + LongVectorEXT = 5425, + Shader64BitIndexingEXT = 5426, + CooperativeMatrixReductionsNV = 5430, + CooperativeMatrixConversionsNV = 5431, + CooperativeMatrixPerElementOperationsNV = 5432, + CooperativeMatrixTensorAddressingNV = 5433, + CooperativeMatrixBlockLoadsNV = 5434, + CooperativeVectorTrainingNV = 5435, + RayTracingClusterAccelerationStructureNV = 5437, + TensorAddressingNV = 5439, + SubgroupShuffleINTEL = 5568, + SubgroupBufferBlockIOINTEL = 5569, + SubgroupImageBlockIOINTEL = 5570, + SubgroupImageMediaBlockIOINTEL = 5579, + RoundToInfinityINTEL = 5582, + FloatingPointModeINTEL = 5583, + IntegerFunctions2INTEL = 5584, + FunctionPointersINTEL = 5603, + IndirectReferencesINTEL = 5604, + AsmINTEL = 5606, + AtomicFloat32MinMaxEXT = 5612, + AtomicFloat64MinMaxEXT = 5613, + AtomicFloat16MinMaxEXT = 5616, + VectorComputeINTEL = 5617, + VectorAnyINTEL = 5619, + ExpectAssumeKHR = 5629, + SubgroupAvcMotionEstimationINTEL = 5696, + SubgroupAvcMotionEstimationIntraINTEL = 5697, + SubgroupAvcMotionEstimationChromaINTEL = 5698, + VariableLengthArrayINTEL = 5817, + FunctionFloatControlINTEL = 5821, + FPGAMemoryAttributesINTEL = 5824, + FPFastMathModeINTEL = 5837, + ArbitraryPrecisionIntegersINTEL = 5844, + ArbitraryPrecisionFloatingPointINTEL = 5845, + UnstructuredLoopControlsINTEL = 5886, + FPGALoopControlsINTEL = 5888, + KernelAttributesINTEL = 5892, + FPGAKernelAttributesINTEL = 5897, + FPGAMemoryAccessesINTEL = 5898, + FPGAClusterAttributesINTEL = 5904, + LoopFuseINTEL = 5906, + FPGADSPControlINTEL = 5908, + MemoryAccessAliasingINTEL = 5910, + FPGAInvocationPipeliningAttributesINTEL = 5916, + FPGABufferLocationINTEL = 5920, + ArbitraryPrecisionFixedPointINTEL = 5922, + USMStorageClassesINTEL = 5935, + RuntimeAlignedAttributeINTEL = 5939, + IOPipesINTEL = 5943, + BlockingPipesINTEL = 5945, + FPGARegINTEL = 5948, + DotProductInputAll = 6016, + DotProductInputAllKHR = 6016, + DotProductInput4x8Bit = 6017, + DotProductInput4x8BitKHR = 6017, + DotProductInput4x8BitPacked = 6018, + DotProductInput4x8BitPackedKHR = 6018, + DotProduct = 6019, + DotProductKHR = 6019, + RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, + ReplicatedCompositesEXT = 6024, + BitInstructions = 6025, + GroupNonUniformRotateKHR = 6026, + FloatControls2 = 6029, + AtomicFloat32AddEXT = 6033, + AtomicFloat64AddEXT = 6034, + LongCompositesINTEL = 6089, + OptNoneEXT = 6094, + OptNoneINTEL = 6094, + AtomicFloat16AddEXT = 6095, + DebugInfoModuleINTEL = 6114, + BFloat16ConversionINTEL = 6115, + SplitBarrierINTEL = 6141, + ArithmeticFenceEXT = 6144, + FPGAClusterAttributesV2INTEL = 6150, + FPGAKernelAttributesv2INTEL = 6161, + FPMaxErrorINTEL = 6169, + FPGALatencyControlINTEL = 6171, + FPGAArgumentInterfacesINTEL = 6174, + GlobalVariableHostAccessINTEL = 6187, + GlobalVariableFPGADecorationsINTEL = 6189, + SubgroupBufferPrefetchINTEL = 6220, + Subgroup2DBlockIOINTEL = 6228, + Subgroup2DBlockTransformINTEL = 6229, + Subgroup2DBlockTransposeINTEL = 6230, + SubgroupMatrixMultiplyAccumulateINTEL = 6236, + GroupUniformArithmeticKHR = 6400, + MaskedGatherScatterINTEL = 6427, + CacheControlsINTEL = 6441, + RegisterLimitsINTEL = 6460, + Max = 0x7fffffff, +}; + +enum class RayFlagsShift : unsigned { + OpaqueKHR = 0, + NoOpaqueKHR = 1, + TerminateOnFirstHitKHR = 2, + SkipClosestHitShaderKHR = 3, + CullBackFacingTrianglesKHR = 4, + CullFrontFacingTrianglesKHR = 5, + CullOpaqueKHR = 6, + CullNoOpaqueKHR = 7, + SkipBuiltinPrimitivesNV = 8, + SkipTrianglesKHR = 8, + SkipAABBsKHR = 9, + ForceOpacityMicromap2StateEXT = 10, + Max = 0x7fffffff, +}; + +enum class RayFlagsMask : unsigned { + MaskNone = 0, + OpaqueKHR = 0x00000001, + NoOpaqueKHR = 0x00000002, + TerminateOnFirstHitKHR = 0x00000004, + SkipClosestHitShaderKHR = 0x00000008, + CullBackFacingTrianglesKHR = 0x00000010, + CullFrontFacingTrianglesKHR = 0x00000020, + CullOpaqueKHR = 0x00000040, + CullNoOpaqueKHR = 0x00000080, + SkipBuiltinPrimitivesNV = 0x00000100, + SkipTrianglesKHR = 0x00000100, + SkipAABBsKHR = 0x00000200, + ForceOpacityMicromap2StateEXT = 0x00000400, +}; + +enum class RayQueryIntersection : unsigned { + RayQueryCandidateIntersectionKHR = 0, + RayQueryCommittedIntersectionKHR = 1, + Max = 0x7fffffff, +}; + +enum class RayQueryCommittedIntersectionType : unsigned { + RayQueryCommittedIntersectionNoneKHR = 0, + RayQueryCommittedIntersectionTriangleKHR = 1, + RayQueryCommittedIntersectionGeneratedKHR = 2, + Max = 0x7fffffff, +}; + +enum class RayQueryCandidateIntersectionType : unsigned { + RayQueryCandidateIntersectionTriangleKHR = 0, + RayQueryCandidateIntersectionAABBKHR = 1, + Max = 0x7fffffff, +}; + +enum class FragmentShadingRateShift : unsigned { + Vertical2Pixels = 0, + Vertical4Pixels = 1, + Horizontal2Pixels = 2, + Horizontal4Pixels = 3, + Max = 0x7fffffff, +}; + +enum class FragmentShadingRateMask : unsigned { + MaskNone = 0, + Vertical2Pixels = 0x00000001, + Vertical4Pixels = 0x00000002, + Horizontal2Pixels = 0x00000004, + Horizontal4Pixels = 0x00000008, +}; + +enum class FPDenormMode : unsigned { + Preserve = 0, + FlushToZero = 1, + Max = 0x7fffffff, +}; + +enum class FPOperationMode : unsigned { + IEEE = 0, + ALT = 1, + Max = 0x7fffffff, +}; + +enum class QuantizationModes : unsigned { + TRN = 0, + TRN_ZERO = 1, + RND = 2, + RND_ZERO = 3, + RND_INF = 4, + RND_MIN_INF = 5, + RND_CONV = 6, + RND_CONV_ODD = 7, + Max = 0x7fffffff, +}; + +enum class OverflowModes : unsigned { + WRAP = 0, + SAT = 1, + SAT_ZERO = 2, + SAT_SYM = 3, + Max = 0x7fffffff, +}; + +enum class PackedVectorFormat : unsigned { + PackedVectorFormat4x8Bit = 0, + PackedVectorFormat4x8BitKHR = 0, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixOperandsShift : unsigned { + MatrixASignedComponentsKHR = 0, + MatrixBSignedComponentsKHR = 1, + MatrixCSignedComponentsKHR = 2, + MatrixResultSignedComponentsKHR = 3, + SaturatingAccumulationKHR = 4, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixOperandsMask : unsigned { + MaskNone = 0, + MatrixASignedComponentsKHR = 0x00000001, + MatrixBSignedComponentsKHR = 0x00000002, + MatrixCSignedComponentsKHR = 0x00000004, + MatrixResultSignedComponentsKHR = 0x00000008, + SaturatingAccumulationKHR = 0x00000010, +}; + +enum class CooperativeMatrixLayout : unsigned { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + RowBlockedInterleavedARM = 4202, + ColumnBlockedInterleavedARM = 4203, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixUse : unsigned { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixReduceShift : unsigned { + Row = 0, + Column = 1, + CooperativeMatrixReduce2x2 = 2, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixReduceMask : unsigned { + MaskNone = 0, + Row = 0x00000001, + Column = 0x00000002, + CooperativeMatrixReduce2x2 = 0x00000004, +}; + +enum class TensorClampMode : unsigned { + Undefined = 0, + Constant = 1, + ClampToEdge = 2, + Repeat = 3, + RepeatMirrored = 4, + Max = 0x7fffffff, +}; + +enum class TensorAddressingOperandsShift : unsigned { + TensorView = 0, + DecodeFunc = 1, + Max = 0x7fffffff, +}; + +enum class TensorAddressingOperandsMask : unsigned { + MaskNone = 0, + TensorView = 0x00000001, + DecodeFunc = 0x00000002, +}; + +enum class TensorOperandsShift : unsigned { + NontemporalARM = 0, + OutOfBoundsValueARM = 1, + Max = 0x7fffffff, +}; + +enum class TensorOperandsMask : unsigned { + MaskNone = 0, + NontemporalARM = 0x00000001, + OutOfBoundsValueARM = 0x00000002, +}; + +enum class InitializationModeQualifier : unsigned { + InitOnDeviceReprogramINTEL = 0, + InitOnDeviceResetINTEL = 1, + Max = 0x7fffffff, +}; + +enum class HostAccessQualifier : unsigned { + NoneINTEL = 0, + ReadINTEL = 1, + WriteINTEL = 2, + ReadWriteINTEL = 3, + Max = 0x7fffffff, +}; + +enum class LoadCacheControl : unsigned { + UncachedINTEL = 0, + CachedINTEL = 1, + StreamingINTEL = 2, + InvalidateAfterReadINTEL = 3, + ConstCachedINTEL = 4, + Max = 0x7fffffff, +}; + +enum class StoreCacheControl : unsigned { + UncachedINTEL = 0, + WriteThroughINTEL = 1, + WriteBackINTEL = 2, + StreamingINTEL = 3, + Max = 0x7fffffff, +}; + +enum class NamedMaximumNumberOfRegisters : unsigned { + AutoINTEL = 0, + Max = 0x7fffffff, +}; + +enum class MatrixMultiplyAccumulateOperandsShift : unsigned { + MatrixASignedComponentsINTEL = 0, + MatrixBSignedComponentsINTEL = 1, + MatrixCBFloat16INTEL = 2, + MatrixResultBFloat16INTEL = 3, + MatrixAPackedInt8INTEL = 4, + MatrixBPackedInt8INTEL = 5, + MatrixAPackedInt4INTEL = 6, + MatrixBPackedInt4INTEL = 7, + MatrixATF32INTEL = 8, + MatrixBTF32INTEL = 9, + MatrixAPackedFloat16INTEL = 10, + MatrixBPackedFloat16INTEL = 11, + MatrixAPackedBFloat16INTEL = 12, + MatrixBPackedBFloat16INTEL = 13, + Max = 0x7fffffff, +}; + +enum class MatrixMultiplyAccumulateOperandsMask : unsigned { + MaskNone = 0, + MatrixASignedComponentsINTEL = 0x00000001, + MatrixBSignedComponentsINTEL = 0x00000002, + MatrixCBFloat16INTEL = 0x00000004, + MatrixResultBFloat16INTEL = 0x00000008, + MatrixAPackedInt8INTEL = 0x00000010, + MatrixBPackedInt8INTEL = 0x00000020, + MatrixAPackedInt4INTEL = 0x00000040, + MatrixBPackedInt4INTEL = 0x00000080, + MatrixATF32INTEL = 0x00000100, + MatrixBTF32INTEL = 0x00000200, + MatrixAPackedFloat16INTEL = 0x00000400, + MatrixBPackedFloat16INTEL = 0x00000800, + MatrixAPackedBFloat16INTEL = 0x00001000, + MatrixBPackedBFloat16INTEL = 0x00002000, +}; + +enum class RawAccessChainOperandsShift : unsigned { + RobustnessPerComponentNV = 0, + RobustnessPerElementNV = 1, + Max = 0x7fffffff, +}; + +enum class RawAccessChainOperandsMask : unsigned { + MaskNone = 0, + RobustnessPerComponentNV = 0x00000001, + RobustnessPerElementNV = 0x00000002, +}; + +enum class FPEncoding : unsigned { + BFloat16KHR = 0, + Float8E4M3EXT = 4214, + Float8E5M2EXT = 4215, + Max = 0x7fffffff, +}; + +enum class CooperativeVectorMatrixLayout : unsigned { + RowMajorNV = 0, + ColumnMajorNV = 1, + InferencingOptimalNV = 2, + TrainingOptimalNV = 3, + Max = 0x7fffffff, +}; + +enum class ComponentType : unsigned { + Float16NV = 0, + Float32NV = 1, + Float64NV = 2, + SignedInt8NV = 3, + SignedInt16NV = 4, + SignedInt32NV = 5, + SignedInt64NV = 6, + UnsignedInt8NV = 7, + UnsignedInt16NV = 8, + UnsignedInt32NV = 9, + UnsignedInt64NV = 10, + SignedInt8PackedNV = 1000491000, + UnsignedInt8PackedNV = 1000491001, + FloatE4M3NV = 1000491002, + FloatE5M2NV = 1000491003, + Max = 0x7fffffff, +}; + +enum class Op : unsigned { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, + OpCopyLogical = 400, + OpPtrEqual = 401, + OpPtrNotEqual = 402, + OpPtrDiff = 403, + OpColorAttachmentReadEXT = 4160, + OpDepthAttachmentReadEXT = 4161, + OpStencilAttachmentReadEXT = 4162, + OpTypeTensorARM = 4163, + OpTensorReadARM = 4164, + OpTensorWriteARM = 4165, + OpTensorQuerySizeARM = 4166, + OpTerminateInvocation = 4416, + OpTypeUntypedPointerKHR = 4417, + OpUntypedVariableKHR = 4418, + OpUntypedAccessChainKHR = 4419, + OpUntypedInBoundsAccessChainKHR = 4420, + OpSubgroupBallotKHR = 4421, + OpSubgroupFirstInvocationKHR = 4422, + OpUntypedPtrAccessChainKHR = 4423, + OpUntypedInBoundsPtrAccessChainKHR = 4424, + OpUntypedArrayLengthKHR = 4425, + OpUntypedPrefetchKHR = 4426, + OpSubgroupAllKHR = 4428, + OpSubgroupAnyKHR = 4429, + OpSubgroupAllEqualKHR = 4430, + OpGroupNonUniformRotateKHR = 4431, + OpSubgroupReadInvocationKHR = 4432, + OpExtInstWithForwardRefsKHR = 4433, + OpTraceRayKHR = 4445, + OpExecuteCallableKHR = 4446, + OpConvertUToAccelerationStructureKHR = 4447, + OpIgnoreIntersectionKHR = 4448, + OpTerminateRayKHR = 4449, + OpSDot = 4450, + OpSDotKHR = 4450, + OpUDot = 4451, + OpUDotKHR = 4451, + OpSUDot = 4452, + OpSUDotKHR = 4452, + OpSDotAccSat = 4453, + OpSDotAccSatKHR = 4453, + OpUDotAccSat = 4454, + OpUDotAccSatKHR = 4454, + OpSUDotAccSat = 4455, + OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, + OpTypeRayQueryKHR = 4472, + OpRayQueryInitializeKHR = 4473, + OpRayQueryTerminateKHR = 4474, + OpRayQueryGenerateIntersectionKHR = 4475, + OpRayQueryConfirmIntersectionKHR = 4476, + OpRayQueryProceedKHR = 4477, + OpRayQueryGetIntersectionTypeKHR = 4479, + OpImageSampleWeightedQCOM = 4480, + OpImageBoxFilterQCOM = 4481, + OpImageBlockMatchSSDQCOM = 4482, + OpImageBlockMatchSADQCOM = 4483, + OpBitCastArrayQCOM = 4497, + OpImageBlockMatchWindowSSDQCOM = 4500, + OpImageBlockMatchWindowSADQCOM = 4501, + OpImageBlockMatchGatherSSDQCOM = 4502, + OpImageBlockMatchGatherSADQCOM = 4503, + OpCompositeConstructCoopMatQCOM = 4540, + OpCompositeExtractCoopMatQCOM = 4541, + OpExtractSubArrayQCOM = 4542, + OpGroupIAddNonUniformAMD = 5000, + OpGroupFAddNonUniformAMD = 5001, + OpGroupFMinNonUniformAMD = 5002, + OpGroupUMinNonUniformAMD = 5003, + OpGroupSMinNonUniformAMD = 5004, + OpGroupFMaxNonUniformAMD = 5005, + OpGroupUMaxNonUniformAMD = 5006, + OpGroupSMaxNonUniformAMD = 5007, + OpFragmentMaskFetchAMD = 5011, + OpFragmentFetchAMD = 5012, + OpReadClockKHR = 5056, + OpAllocateNodePayloadsAMDX = 5074, + OpEnqueueNodePayloadsAMDX = 5075, + OpTypeNodePayloadArrayAMDX = 5076, + OpFinishWritingNodePayloadAMDX = 5078, + OpNodePayloadArrayLengthAMDX = 5090, + OpIsNodePayloadValidAMDX = 5101, + OpConstantStringAMDX = 5103, + OpSpecConstantStringAMDX = 5104, + OpGroupNonUniformQuadAllKHR = 5110, + OpGroupNonUniformQuadAnyKHR = 5111, + OpHitObjectRecordHitMotionNV = 5249, + OpHitObjectRecordHitWithIndexMotionNV = 5250, + OpHitObjectRecordMissMotionNV = 5251, + OpHitObjectGetWorldToObjectNV = 5252, + OpHitObjectGetObjectToWorldNV = 5253, + OpHitObjectGetObjectRayDirectionNV = 5254, + OpHitObjectGetObjectRayOriginNV = 5255, + OpHitObjectTraceRayMotionNV = 5256, + OpHitObjectGetShaderRecordBufferHandleNV = 5257, + OpHitObjectGetShaderBindingTableRecordIndexNV = 5258, + OpHitObjectRecordEmptyNV = 5259, + OpHitObjectTraceRayNV = 5260, + OpHitObjectRecordHitNV = 5261, + OpHitObjectRecordHitWithIndexNV = 5262, + OpHitObjectRecordMissNV = 5263, + OpHitObjectExecuteShaderNV = 5264, + OpHitObjectGetCurrentTimeNV = 5265, + OpHitObjectGetAttributesNV = 5266, + OpHitObjectGetHitKindNV = 5267, + OpHitObjectGetPrimitiveIndexNV = 5268, + OpHitObjectGetGeometryIndexNV = 5269, + OpHitObjectGetInstanceIdNV = 5270, + OpHitObjectGetInstanceCustomIndexNV = 5271, + OpHitObjectGetWorldRayDirectionNV = 5272, + OpHitObjectGetWorldRayOriginNV = 5273, + OpHitObjectGetRayTMaxNV = 5274, + OpHitObjectGetRayTMinNV = 5275, + OpHitObjectIsEmptyNV = 5276, + OpHitObjectIsHitNV = 5277, + OpHitObjectIsMissNV = 5278, + OpReorderThreadWithHitObjectNV = 5279, + OpReorderThreadWithHintNV = 5280, + OpTypeHitObjectNV = 5281, + OpImageSampleFootprintNV = 5283, + OpTypeCooperativeVectorNV = 5288, + OpTypeVectorIdEXT = 5288, + OpCooperativeVectorMatrixMulNV = 5289, + OpCooperativeVectorOuterProductAccumulateNV = 5290, + OpCooperativeVectorReduceSumAccumulateNV = 5291, + OpCooperativeVectorMatrixMulAddNV = 5292, + OpCooperativeMatrixConvertNV = 5293, + OpEmitMeshTasksEXT = 5294, + OpSetMeshOutputsEXT = 5295, + OpGroupNonUniformPartitionNV = 5296, + OpWritePackedPrimitiveIndices4x8NV = 5299, + OpFetchMicroTriangleVertexPositionNV = 5300, + OpFetchMicroTriangleVertexBarycentricNV = 5301, + OpCooperativeVectorLoadNV = 5302, + OpCooperativeVectorStoreNV = 5303, + OpHitObjectRecordFromQueryEXT = 5304, + OpHitObjectRecordMissEXT = 5305, + OpHitObjectRecordMissMotionEXT = 5306, + OpHitObjectGetIntersectionTriangleVertexPositionsEXT = 5307, + OpHitObjectGetRayFlagsEXT = 5308, + OpHitObjectSetShaderBindingTableRecordIndexEXT = 5309, + OpHitObjectReorderExecuteShaderEXT = 5310, + OpHitObjectTraceReorderExecuteEXT = 5311, + OpHitObjectTraceMotionReorderExecuteEXT = 5312, + OpTypeHitObjectEXT = 5313, + OpReorderThreadWithHintEXT = 5314, + OpReorderThreadWithHitObjectEXT = 5315, + OpHitObjectTraceRayEXT = 5316, + OpHitObjectTraceRayMotionEXT = 5317, + OpHitObjectRecordEmptyEXT = 5318, + OpHitObjectExecuteShaderEXT = 5319, + OpHitObjectGetCurrentTimeEXT = 5320, + OpHitObjectGetAttributesEXT = 5321, + OpHitObjectGetHitKindEXT = 5322, + OpHitObjectGetPrimitiveIndexEXT = 5323, + OpHitObjectGetGeometryIndexEXT = 5324, + OpHitObjectGetInstanceIdEXT = 5325, + OpHitObjectGetInstanceCustomIndexEXT = 5326, + OpHitObjectGetObjectRayOriginEXT = 5327, + OpHitObjectGetObjectRayDirectionEXT = 5328, + OpHitObjectGetWorldRayDirectionEXT = 5329, + OpHitObjectGetWorldRayOriginEXT = 5330, + OpHitObjectGetObjectToWorldEXT = 5331, + OpHitObjectGetWorldToObjectEXT = 5332, + OpHitObjectGetRayTMaxEXT = 5333, + OpReportIntersectionKHR = 5334, + OpReportIntersectionNV = 5334, + OpIgnoreIntersectionNV = 5335, + OpTerminateRayNV = 5336, + OpTraceNV = 5337, + OpTraceMotionNV = 5338, + OpTraceRayMotionNV = 5339, + OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340, + OpTypeAccelerationStructureKHR = 5341, + OpTypeAccelerationStructureNV = 5341, + OpExecuteCallableNV = 5344, + OpRayQueryGetClusterIdNV = 5345, + OpHitObjectGetClusterIdNV = 5346, + OpHitObjectGetRayTMinEXT = 5347, + OpHitObjectGetShaderBindingTableRecordIndexEXT = 5348, + OpHitObjectGetShaderRecordBufferHandleEXT = 5349, + OpHitObjectIsEmptyEXT = 5350, + OpHitObjectIsHitEXT = 5351, + OpHitObjectIsMissEXT = 5352, + OpTypeCooperativeMatrixNV = 5358, + OpCooperativeMatrixLoadNV = 5359, + OpCooperativeMatrixStoreNV = 5360, + OpCooperativeMatrixMulAddNV = 5361, + OpCooperativeMatrixLengthNV = 5362, + OpBeginInvocationInterlockEXT = 5364, + OpEndInvocationInterlockEXT = 5365, + OpCooperativeMatrixReduceNV = 5366, + OpCooperativeMatrixLoadTensorNV = 5367, + OpCooperativeMatrixStoreTensorNV = 5368, + OpCooperativeMatrixPerElementOpNV = 5369, + OpTypeTensorLayoutNV = 5370, + OpTypeTensorViewNV = 5371, + OpCreateTensorLayoutNV = 5372, + OpTensorLayoutSetDimensionNV = 5373, + OpTensorLayoutSetStrideNV = 5374, + OpTensorLayoutSliceNV = 5375, + OpTensorLayoutSetClampValueNV = 5376, + OpCreateTensorViewNV = 5377, + OpTensorViewSetDimensionNV = 5378, + OpTensorViewSetStrideNV = 5379, + OpDemoteToHelperInvocation = 5380, + OpDemoteToHelperInvocationEXT = 5380, + OpIsHelperInvocationEXT = 5381, + OpTensorViewSetClipNV = 5382, + OpTensorLayoutSetBlockSizeNV = 5384, + OpCooperativeMatrixTransposeNV = 5390, + OpConvertUToImageNV = 5391, + OpConvertUToSamplerNV = 5392, + OpConvertImageToUNV = 5393, + OpConvertSamplerToUNV = 5394, + OpConvertUToSampledImageNV = 5395, + OpConvertSampledImageToUNV = 5396, + OpSamplerImageAddressingModeNV = 5397, + OpRawAccessChainNV = 5398, + OpRayQueryGetIntersectionSpherePositionNV = 5427, + OpRayQueryGetIntersectionSphereRadiusNV = 5428, + OpRayQueryGetIntersectionLSSPositionsNV = 5429, + OpRayQueryGetIntersectionLSSRadiiNV = 5430, + OpRayQueryGetIntersectionLSSHitValueNV = 5431, + OpHitObjectGetSpherePositionNV = 5432, + OpHitObjectGetSphereRadiusNV = 5433, + OpHitObjectGetLSSPositionsNV = 5434, + OpHitObjectGetLSSRadiiNV = 5435, + OpHitObjectIsSphereHitNV = 5436, + OpHitObjectIsLSSHitNV = 5437, + OpRayQueryIsSphereHitNV = 5438, + OpRayQueryIsLSSHitNV = 5439, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpSubgroupImageMediaBlockReadINTEL = 5580, + OpSubgroupImageMediaBlockWriteINTEL = 5581, + OpUCountLeadingZerosINTEL = 5585, + OpUCountTrailingZerosINTEL = 5586, + OpAbsISubINTEL = 5587, + OpAbsUSubINTEL = 5588, + OpIAddSatINTEL = 5589, + OpUAddSatINTEL = 5590, + OpIAverageINTEL = 5591, + OpUAverageINTEL = 5592, + OpIAverageRoundedINTEL = 5593, + OpUAverageRoundedINTEL = 5594, + OpISubSatINTEL = 5595, + OpUSubSatINTEL = 5596, + OpIMul32x16INTEL = 5597, + OpUMul32x16INTEL = 5598, + OpConstantFunctionPointerINTEL = 5600, + OpFunctionPointerCallINTEL = 5601, + OpAsmTargetINTEL = 5609, + OpAsmINTEL = 5610, + OpAsmCallINTEL = 5611, + OpAtomicFMinEXT = 5614, + OpAtomicFMaxEXT = 5615, + OpAssumeTrueKHR = 5630, + OpExpectKHR = 5631, + OpDecorateString = 5632, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateString = 5633, + OpMemberDecorateStringGOOGLE = 5633, + OpVmeImageINTEL = 5699, + OpTypeVmeImageINTEL = 5700, + OpTypeAvcImePayloadINTEL = 5701, + OpTypeAvcRefPayloadINTEL = 5702, + OpTypeAvcSicPayloadINTEL = 5703, + OpTypeAvcMcePayloadINTEL = 5704, + OpTypeAvcMceResultINTEL = 5705, + OpTypeAvcImeResultINTEL = 5706, + OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, + OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, + OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, + OpTypeAvcImeDualReferenceStreaminINTEL = 5710, + OpTypeAvcRefResultINTEL = 5711, + OpTypeAvcSicResultINTEL = 5712, + OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, + OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, + OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, + OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, + OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, + OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, + OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, + OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, + OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, + OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, + OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, + OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, + OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, + OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, + OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, + OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, + OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, + OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, + OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, + OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, + OpSubgroupAvcMceConvertToImeResultINTEL = 5733, + OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, + OpSubgroupAvcMceConvertToRefResultINTEL = 5735, + OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, + OpSubgroupAvcMceConvertToSicResultINTEL = 5737, + OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, + OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, + OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, + OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, + OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, + OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, + OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, + OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, + OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, + OpSubgroupAvcImeInitializeINTEL = 5747, + OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, + OpSubgroupAvcImeSetDualReferenceINTEL = 5749, + OpSubgroupAvcImeRefWindowSizeINTEL = 5750, + OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, + OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, + OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, + OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, + OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, + OpSubgroupAvcImeSetWeightedSadINTEL = 5756, + OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, + OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, + OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, + OpSubgroupAvcImeConvertToMceResultINTEL = 5765, + OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, + OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, + OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, + OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, + OpSubgroupAvcImeGetBorderReachedINTEL = 5776, + OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, + OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, + OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, + OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, + OpSubgroupAvcFmeInitializeINTEL = 5781, + OpSubgroupAvcBmeInitializeINTEL = 5782, + OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, + OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, + OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, + OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, + OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, + OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, + OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, + OpSubgroupAvcRefConvertToMceResultINTEL = 5790, + OpSubgroupAvcSicInitializeINTEL = 5791, + OpSubgroupAvcSicConfigureSkcINTEL = 5792, + OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, + OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, + OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, + OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, + OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, + OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, + OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, + OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, + OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, + OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, + OpSubgroupAvcSicEvaluateIpeINTEL = 5803, + OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, + OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, + OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, + OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, + OpSubgroupAvcSicConvertToMceResultINTEL = 5808, + OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, + OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, + OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, + OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, + OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, + OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, + OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, + OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, + OpVariableLengthArrayINTEL = 5818, + OpSaveMemoryINTEL = 5819, + OpRestoreMemoryINTEL = 5820, + OpArbitraryFloatSinCosPiINTEL = 5840, + OpArbitraryFloatCastINTEL = 5841, + OpArbitraryFloatCastFromIntINTEL = 5842, + OpArbitraryFloatCastToIntINTEL = 5843, + OpArbitraryFloatAddINTEL = 5846, + OpArbitraryFloatSubINTEL = 5847, + OpArbitraryFloatMulINTEL = 5848, + OpArbitraryFloatDivINTEL = 5849, + OpArbitraryFloatGTINTEL = 5850, + OpArbitraryFloatGEINTEL = 5851, + OpArbitraryFloatLTINTEL = 5852, + OpArbitraryFloatLEINTEL = 5853, + OpArbitraryFloatEQINTEL = 5854, + OpArbitraryFloatRecipINTEL = 5855, + OpArbitraryFloatRSqrtINTEL = 5856, + OpArbitraryFloatCbrtINTEL = 5857, + OpArbitraryFloatHypotINTEL = 5858, + OpArbitraryFloatSqrtINTEL = 5859, + OpArbitraryFloatLogINTEL = 5860, + OpArbitraryFloatLog2INTEL = 5861, + OpArbitraryFloatLog10INTEL = 5862, + OpArbitraryFloatLog1pINTEL = 5863, + OpArbitraryFloatExpINTEL = 5864, + OpArbitraryFloatExp2INTEL = 5865, + OpArbitraryFloatExp10INTEL = 5866, + OpArbitraryFloatExpm1INTEL = 5867, + OpArbitraryFloatSinINTEL = 5868, + OpArbitraryFloatCosINTEL = 5869, + OpArbitraryFloatSinCosINTEL = 5870, + OpArbitraryFloatSinPiINTEL = 5871, + OpArbitraryFloatCosPiINTEL = 5872, + OpArbitraryFloatASinINTEL = 5873, + OpArbitraryFloatASinPiINTEL = 5874, + OpArbitraryFloatACosINTEL = 5875, + OpArbitraryFloatACosPiINTEL = 5876, + OpArbitraryFloatATanINTEL = 5877, + OpArbitraryFloatATanPiINTEL = 5878, + OpArbitraryFloatATan2INTEL = 5879, + OpArbitraryFloatPowINTEL = 5880, + OpArbitraryFloatPowRINTEL = 5881, + OpArbitraryFloatPowNINTEL = 5882, + OpLoopControlINTEL = 5887, + OpAliasDomainDeclINTEL = 5911, + OpAliasScopeDeclINTEL = 5912, + OpAliasScopeListDeclINTEL = 5913, + OpFixedSqrtINTEL = 5923, + OpFixedRecipINTEL = 5924, + OpFixedRsqrtINTEL = 5925, + OpFixedSinINTEL = 5926, + OpFixedCosINTEL = 5927, + OpFixedSinCosINTEL = 5928, + OpFixedSinPiINTEL = 5929, + OpFixedCosPiINTEL = 5930, + OpFixedSinCosPiINTEL = 5931, + OpFixedLogINTEL = 5932, + OpFixedExpINTEL = 5933, + OpPtrCastToCrossWorkgroupINTEL = 5934, + OpCrossWorkgroupCastToPtrINTEL = 5938, + OpReadPipeBlockingINTEL = 5946, + OpWritePipeBlockingINTEL = 5947, + OpFPGARegINTEL = 5949, + OpRayQueryGetRayTMinKHR = 6016, + OpRayQueryGetRayFlagsKHR = 6017, + OpRayQueryGetIntersectionTKHR = 6018, + OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, + OpRayQueryGetIntersectionInstanceIdKHR = 6020, + OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, + OpRayQueryGetIntersectionGeometryIndexKHR = 6022, + OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, + OpRayQueryGetIntersectionBarycentricsKHR = 6024, + OpRayQueryGetIntersectionFrontFaceKHR = 6025, + OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, + OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, + OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, + OpRayQueryGetWorldRayDirectionKHR = 6029, + OpRayQueryGetWorldRayOriginKHR = 6030, + OpRayQueryGetIntersectionObjectToWorldKHR = 6031, + OpRayQueryGetIntersectionWorldToObjectKHR = 6032, + OpAtomicFAddEXT = 6035, + OpTypeBufferSurfaceINTEL = 6086, + OpTypeStructContinuedINTEL = 6090, + OpConstantCompositeContinuedINTEL = 6091, + OpSpecConstantCompositeContinuedINTEL = 6092, + OpCompositeConstructContinuedINTEL = 6096, + OpConvertFToBF16INTEL = 6116, + OpConvertBF16ToFINTEL = 6117, + OpControlBarrierArriveINTEL = 6142, + OpControlBarrierWaitINTEL = 6143, + OpArithmeticFenceEXT = 6145, + OpSubgroupBlockPrefetchINTEL = 6221, + OpSubgroup2DBlockLoadINTEL = 6231, + OpSubgroup2DBlockLoadTransformINTEL = 6232, + OpSubgroup2DBlockLoadTransposeINTEL = 6233, + OpSubgroup2DBlockPrefetchINTEL = 6234, + OpSubgroup2DBlockStoreINTEL = 6235, + OpSubgroupMatrixMultiplyAccumulateINTEL = 6237, + OpGroupIMulKHR = 6401, + OpGroupFMulKHR = 6402, + OpGroupBitwiseAndKHR = 6403, + OpGroupBitwiseOrKHR = 6404, + OpGroupBitwiseXorKHR = 6405, + OpGroupLogicalAndKHR = 6406, + OpGroupLogicalOrKHR = 6407, + OpGroupLogicalXorKHR = 6408, + OpMaskedGatherINTEL = 6428, + OpMaskedScatterINTEL = 6429, + Max = 0x7fffffff, +}; + +#ifdef SPV_ENABLE_UTILITY_CODE +#ifndef __cplusplus +#include +#endif +inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { + *hasResult = *hasResultType = false; + switch (opcode) { + default: /* unknown opcode */ break; + case Op::OpNop: *hasResult = false; *hasResultType = false; break; + case Op::OpUndef: *hasResult = true; *hasResultType = true; break; + case Op::OpSourceContinued: *hasResult = false; *hasResultType = false; break; + case Op::OpSource: *hasResult = false; *hasResultType = false; break; + case Op::OpSourceExtension: *hasResult = false; *hasResultType = false; break; + case Op::OpName: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberName: *hasResult = false; *hasResultType = false; break; + case Op::OpString: *hasResult = true; *hasResultType = false; break; + case Op::OpLine: *hasResult = false; *hasResultType = false; break; + case Op::OpExtension: *hasResult = false; *hasResultType = false; break; + case Op::OpExtInstImport: *hasResult = true; *hasResultType = false; break; + case Op::OpExtInst: *hasResult = true; *hasResultType = true; break; + case Op::OpMemoryModel: *hasResult = false; *hasResultType = false; break; + case Op::OpEntryPoint: *hasResult = false; *hasResultType = false; break; + case Op::OpExecutionMode: *hasResult = false; *hasResultType = false; break; + case Op::OpCapability: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeVoid: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeBool: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeInt: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeFloat: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeVector: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeMatrix: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeImage: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeSampler: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeSampledImage: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeArray: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeStruct: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeOpaque: *hasResult = true; *hasResultType = false; break; + case Op::OpTypePointer: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeFunction: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeEvent: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeReserveId: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeQueue: *hasResult = true; *hasResultType = false; break; + case Op::OpTypePipe: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break; + case Op::OpConstantTrue: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantFalse: *hasResult = true; *hasResultType = true; break; + case Op::OpConstant: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantComposite: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantSampler: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantNull: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstant: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantOp: *hasResult = true; *hasResultType = true; break; + case Op::OpFunction: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionParameter: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionEnd: *hasResult = false; *hasResultType = false; break; + case Op::OpFunctionCall: *hasResult = true; *hasResultType = true; break; + case Op::OpVariable: *hasResult = true; *hasResultType = true; break; + case Op::OpImageTexelPointer: *hasResult = true; *hasResultType = true; break; + case Op::OpLoad: *hasResult = true; *hasResultType = true; break; + case Op::OpStore: *hasResult = false; *hasResultType = false; break; + case Op::OpCopyMemory: *hasResult = false; *hasResultType = false; break; + case Op::OpCopyMemorySized: *hasResult = false; *hasResultType = false; break; + case Op::OpAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpArrayLength: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break; + case Op::OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case Op::OpDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpDecorationGroup: *hasResult = true; *hasResultType = false; break; + case Op::OpGroupDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break; + case Op::OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorShuffle: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstruct: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeInsert: *hasResult = true; *hasResultType = true; break; + case Op::OpCopyObject: *hasResult = true; *hasResultType = true; break; + case Op::OpTranspose: *hasResult = true; *hasResultType = true; break; + case Op::OpSampledImage: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageFetch: *hasResult = true; *hasResultType = true; break; + case Op::OpImageGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageDrefGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageRead: *hasResult = true; *hasResultType = true; break; + case Op::OpImageWrite: *hasResult = false; *hasResultType = false; break; + case Op::OpImage: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryFormat: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryOrder: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySize: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQueryLevels: *hasResult = true; *hasResultType = true; break; + case Op::OpImageQuerySamples: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToU: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToS: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSToF: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToF: *hasResult = true; *hasResultType = true; break; + case Op::OpUConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpSConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpFConvert: *hasResult = true; *hasResultType = true; break; + case Op::OpQuantizeToF16: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertPtrToU: *hasResult = true; *hasResultType = true; break; + case Op::OpSatConvertSToU: *hasResult = true; *hasResultType = true; break; + case Op::OpSatConvertUToS: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToPtr: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break; + case Op::OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break; + case Op::OpBitcast: *hasResult = true; *hasResultType = true; break; + case Op::OpSNegate: *hasResult = true; *hasResultType = true; break; + case Op::OpFNegate: *hasResult = true; *hasResultType = true; break; + case Op::OpIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpISub: *hasResult = true; *hasResultType = true; break; + case Op::OpFSub: *hasResult = true; *hasResultType = true; break; + case Op::OpIMul: *hasResult = true; *hasResultType = true; break; + case Op::OpFMul: *hasResult = true; *hasResultType = true; break; + case Op::OpUDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpSDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpFDiv: *hasResult = true; *hasResultType = true; break; + case Op::OpUMod: *hasResult = true; *hasResultType = true; break; + case Op::OpSRem: *hasResult = true; *hasResultType = true; break; + case Op::OpSMod: *hasResult = true; *hasResultType = true; break; + case Op::OpFRem: *hasResult = true; *hasResultType = true; break; + case Op::OpFMod: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break; + case Op::OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break; + case Op::OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break; + case Op::OpOuterProduct: *hasResult = true; *hasResultType = true; break; + case Op::OpDot: *hasResult = true; *hasResultType = true; break; + case Op::OpIAddCarry: *hasResult = true; *hasResultType = true; break; + case Op::OpISubBorrow: *hasResult = true; *hasResultType = true; break; + case Op::OpUMulExtended: *hasResult = true; *hasResultType = true; break; + case Op::OpSMulExtended: *hasResult = true; *hasResultType = true; break; + case Op::OpAny: *hasResult = true; *hasResultType = true; break; + case Op::OpAll: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNan: *hasResult = true; *hasResultType = true; break; + case Op::OpIsInf: *hasResult = true; *hasResultType = true; break; + case Op::OpIsFinite: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNormal: *hasResult = true; *hasResultType = true; break; + case Op::OpSignBitSet: *hasResult = true; *hasResultType = true; break; + case Op::OpLessOrGreater: *hasResult = true; *hasResultType = true; break; + case Op::OpOrdered: *hasResult = true; *hasResultType = true; break; + case Op::OpUnordered: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalOr: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpLogicalNot: *hasResult = true; *hasResultType = true; break; + case Op::OpSelect: *hasResult = true; *hasResultType = true; break; + case Op::OpIEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpINotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpUGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpSGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpULessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpSLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpULessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpSLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordLessThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftRightLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break; + case Op::OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseOr: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseXor: *hasResult = true; *hasResultType = true; break; + case Op::OpBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpNot: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldInsert: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpBitReverse: *hasResult = true; *hasResultType = true; break; + case Op::OpBitCount: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdx: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdy: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidth: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdxFine: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdyFine: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidthFine: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdxCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpDPdyCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpFwidthCoarse: *hasResult = true; *hasResultType = true; break; + case Op::OpEmitVertex: *hasResult = false; *hasResultType = false; break; + case Op::OpEndPrimitive: *hasResult = false; *hasResultType = false; break; + case Op::OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break; + case Op::OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break; + case Op::OpControlBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpMemoryBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicLoad: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicStore: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicExchange: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicISub: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicOr: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicXor: *hasResult = true; *hasResultType = true; break; + case Op::OpPhi: *hasResult = true; *hasResultType = true; break; + case Op::OpLoopMerge: *hasResult = false; *hasResultType = false; break; + case Op::OpSelectionMerge: *hasResult = false; *hasResultType = false; break; + case Op::OpLabel: *hasResult = true; *hasResultType = false; break; + case Op::OpBranch: *hasResult = false; *hasResultType = false; break; + case Op::OpBranchConditional: *hasResult = false; *hasResultType = false; break; + case Op::OpSwitch: *hasResult = false; *hasResultType = false; break; + case Op::OpKill: *hasResult = false; *hasResultType = false; break; + case Op::OpReturn: *hasResult = false; *hasResultType = false; break; + case Op::OpReturnValue: *hasResult = false; *hasResultType = false; break; + case Op::OpUnreachable: *hasResult = false; *hasResultType = false; break; + case Op::OpLifetimeStart: *hasResult = false; *hasResultType = false; break; + case Op::OpLifetimeStop: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupAll: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupAny: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpReadPipe: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReservedReadPipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReservedWritePipe: *hasResult = true; *hasResultType = true; break; + case Op::OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case Op::OpCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case Op::OpIsValidReserveId: *hasResult = true; *hasResultType = true; break; + case Op::OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case Op::OpEnqueueMarker: *hasResult = true; *hasResultType = true; break; + case Op::OpEnqueueKernel: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break; + case Op::OpRetainEvent: *hasResult = false; *hasResultType = false; break; + case Op::OpReleaseEvent: *hasResult = false; *hasResultType = false; break; + case Op::OpCreateUserEvent: *hasResult = true; *hasResultType = true; break; + case Op::OpIsValidEvent: *hasResult = true; *hasResultType = true; break; + case Op::OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break; + case Op::OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break; + case Op::OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break; + case Op::OpBuildNDRange: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseFetch: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break; + case Op::OpNoLine: *hasResult = false; *hasResultType = false; break; + case Op::OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break; + case Op::OpImageSparseRead: *hasResult = true; *hasResultType = true; break; + case Op::OpSizeOf: *hasResult = true; *hasResultType = true; break; + case Op::OpTypePipeStorage: *hasResult = true; *hasResultType = false; break; + case Op::OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break; + case Op::OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break; + case Op::OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break; + case Op::OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break; + case Op::OpModuleProcessed: *hasResult = false; *hasResultType = false; break; + case Op::OpExecutionModeId: *hasResult = false; *hasResultType = false; break; + case Op::OpDecorateId: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break; + case Op::OpCopyLogical: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrDiff: *hasResult = true; *hasResultType = true; break; + case Op::OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeTensorARM: *hasResult = true; *hasResultType = false; break; + case Op::OpTensorReadARM: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorWriteARM: *hasResult = false; *hasResultType = false; break; + case Op::OpTensorQuerySizeARM: *hasResult = true; *hasResultType = true; break; + case Op::OpTerminateInvocation: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedInBoundsAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedInBoundsPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedArrayLengthKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedPrefetchKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpTraceRayKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpSDot: *hasResult = true; *hasResultType = true; break; + case Op::OpUDot: *hasResult = true; *hasResultType = true; break; + case Op::OpSUDot: *hasResult = true; *hasResultType = true; break; + case Op::OpSDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpUDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstructReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpImageSampleWeightedQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpBitCastArrayQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstructCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeExtractCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpExtractSubArrayQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; + case Op::OpReadClockKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpAllocateNodePayloadsAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpEnqueueNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeNodePayloadArrayAMDX: *hasResult = true; *hasResultType = false; break; + case Op::OpFinishWritingNodePayloadAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpNodePayloadArrayLengthAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpIsNodePayloadValidAMDX: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case Op::OpSpecConstantStringAMDX: *hasResult = true; *hasResultType = false; break; + case Op::OpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break; + case Op::OpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break; + case Op::OpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break; + case Op::OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeVectorNV: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeVectorMatrixMulNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeVectorOuterProductAccumulateNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeVectorReduceSumAccumulateNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeVectorMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixConvertNV: *hasResult = true; *hasResultType = true; break; + case Op::OpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; + case Op::OpFetchMicroTriangleVertexPositionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeVectorLoadNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeVectorStoreNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordFromQueryEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissMotionEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayFlagsEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectReorderExecuteShaderEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceReorderExecuteEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceMotionReorderExecuteEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeHitObjectEXT: *hasResult = true; *hasResultType = false; break; + case Op::OpReorderThreadWithHintEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpReorderThreadWithHitObjectEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayMotionEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordEmptyEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectExecuteShaderEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetCurrentTimeEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetAttributesEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetHitKindEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetPrimitiveIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetGeometryIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceIdEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceCustomIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayOriginEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayDirectionEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayDirectionEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayOriginEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectToWorldEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldToObjectEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMaxEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTerminateRayNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeAccelerationStructureKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; + case Op::OpRayQueryGetClusterIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetClusterIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMinEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderRecordBufferHandleEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsEmptyEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsHitEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsMissEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break; + case Op::OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixReduceNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLoadTensorNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreTensorNV: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixPerElementOpNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeTensorLayoutNV: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeTensorViewNV: *hasResult = true; *hasResultType = false; break; + case Op::OpCreateTensorLayoutNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetDimensionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetStrideNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSliceNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetClampValueNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCreateTensorViewNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorViewSetDimensionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorViewSetStrideNV: *hasResult = true; *hasResultType = true; break; + case Op::OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break; + case Op::OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorViewSetClipNV: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorLayoutSetBlockSizeNV: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixTransposeNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break; + case Op::OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break; + case Op::OpRawAccessChainNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionSpherePositionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionSphereRadiusNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionLSSPositionsNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionLSSRadiiNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionLSSHitValueNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetSpherePositionNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetSphereRadiusNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetLSSPositionsNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetLSSRadiiNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsSphereHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsLSSHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryIsSphereHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryIsLSSHitNV: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAverageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAverageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpISubSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAsmTargetINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAsmINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpExpectKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpDecorateString: *hasResult = false; *hasResultType = false; break; + case Op::OpMemberDecorateString: *hasResult = false; *hasResultType = false; break; + case Op::OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break; + case Op::OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpCompositeConstructContinuedINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertFToBF16INTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpArithmeticFenceEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpSubgroupBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockLoadINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockLoadTransformINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockLoadTransposeINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroup2DBlockStoreINTEL: *hasResult = false; *hasResultType = false; break; + case Op::OpSubgroupMatrixMultiplyAccumulateINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break; + case Op::OpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break; + } +} +inline const char* SourceLanguageToString(SourceLanguage value) { + switch (value) { + case SourceLanguage::Unknown: return "Unknown"; + case SourceLanguage::ESSL: return "ESSL"; + case SourceLanguage::GLSL: return "GLSL"; + case SourceLanguage::OpenCL_C: return "OpenCL_C"; + case SourceLanguage::OpenCL_CPP: return "OpenCL_CPP"; + case SourceLanguage::HLSL: return "HLSL"; + case SourceLanguage::CPP_for_OpenCL: return "CPP_for_OpenCL"; + case SourceLanguage::SYCL: return "SYCL"; + case SourceLanguage::HERO_C: return "HERO_C"; + case SourceLanguage::NZSL: return "NZSL"; + case SourceLanguage::WGSL: return "WGSL"; + case SourceLanguage::Slang: return "Slang"; + case SourceLanguage::Zig: return "Zig"; + case SourceLanguage::Rust: return "Rust"; + default: return "Unknown"; + } +} + +inline const char* ExecutionModelToString(ExecutionModel value) { + switch (value) { + case ExecutionModel::Vertex: return "Vertex"; + case ExecutionModel::TessellationControl: return "TessellationControl"; + case ExecutionModel::TessellationEvaluation: return "TessellationEvaluation"; + case ExecutionModel::Geometry: return "Geometry"; + case ExecutionModel::Fragment: return "Fragment"; + case ExecutionModel::GLCompute: return "GLCompute"; + case ExecutionModel::Kernel: return "Kernel"; + case ExecutionModel::TaskNV: return "TaskNV"; + case ExecutionModel::MeshNV: return "MeshNV"; + case ExecutionModel::RayGenerationKHR: return "RayGenerationKHR"; + case ExecutionModel::IntersectionKHR: return "IntersectionKHR"; + case ExecutionModel::AnyHitKHR: return "AnyHitKHR"; + case ExecutionModel::ClosestHitKHR: return "ClosestHitKHR"; + case ExecutionModel::MissKHR: return "MissKHR"; + case ExecutionModel::CallableKHR: return "CallableKHR"; + case ExecutionModel::TaskEXT: return "TaskEXT"; + case ExecutionModel::MeshEXT: return "MeshEXT"; + default: return "Unknown"; + } +} + +inline const char* AddressingModelToString(AddressingModel value) { + switch (value) { + case AddressingModel::Logical: return "Logical"; + case AddressingModel::Physical32: return "Physical32"; + case AddressingModel::Physical64: return "Physical64"; + case AddressingModel::PhysicalStorageBuffer64: return "PhysicalStorageBuffer64"; + default: return "Unknown"; + } +} + +inline const char* MemoryModelToString(MemoryModel value) { + switch (value) { + case MemoryModel::Simple: return "Simple"; + case MemoryModel::GLSL450: return "GLSL450"; + case MemoryModel::OpenCL: return "OpenCL"; + case MemoryModel::Vulkan: return "Vulkan"; + default: return "Unknown"; + } +} + +inline const char* ExecutionModeToString(ExecutionMode value) { + switch (value) { + case ExecutionMode::Invocations: return "Invocations"; + case ExecutionMode::SpacingEqual: return "SpacingEqual"; + case ExecutionMode::SpacingFractionalEven: return "SpacingFractionalEven"; + case ExecutionMode::SpacingFractionalOdd: return "SpacingFractionalOdd"; + case ExecutionMode::VertexOrderCw: return "VertexOrderCw"; + case ExecutionMode::VertexOrderCcw: return "VertexOrderCcw"; + case ExecutionMode::PixelCenterInteger: return "PixelCenterInteger"; + case ExecutionMode::OriginUpperLeft: return "OriginUpperLeft"; + case ExecutionMode::OriginLowerLeft: return "OriginLowerLeft"; + case ExecutionMode::EarlyFragmentTests: return "EarlyFragmentTests"; + case ExecutionMode::PointMode: return "PointMode"; + case ExecutionMode::Xfb: return "Xfb"; + case ExecutionMode::DepthReplacing: return "DepthReplacing"; + case ExecutionMode::DepthGreater: return "DepthGreater"; + case ExecutionMode::DepthLess: return "DepthLess"; + case ExecutionMode::DepthUnchanged: return "DepthUnchanged"; + case ExecutionMode::LocalSize: return "LocalSize"; + case ExecutionMode::LocalSizeHint: return "LocalSizeHint"; + case ExecutionMode::InputPoints: return "InputPoints"; + case ExecutionMode::InputLines: return "InputLines"; + case ExecutionMode::InputLinesAdjacency: return "InputLinesAdjacency"; + case ExecutionMode::Triangles: return "Triangles"; + case ExecutionMode::InputTrianglesAdjacency: return "InputTrianglesAdjacency"; + case ExecutionMode::Quads: return "Quads"; + case ExecutionMode::Isolines: return "Isolines"; + case ExecutionMode::OutputVertices: return "OutputVertices"; + case ExecutionMode::OutputPoints: return "OutputPoints"; + case ExecutionMode::OutputLineStrip: return "OutputLineStrip"; + case ExecutionMode::OutputTriangleStrip: return "OutputTriangleStrip"; + case ExecutionMode::VecTypeHint: return "VecTypeHint"; + case ExecutionMode::ContractionOff: return "ContractionOff"; + case ExecutionMode::Initializer: return "Initializer"; + case ExecutionMode::Finalizer: return "Finalizer"; + case ExecutionMode::SubgroupSize: return "SubgroupSize"; + case ExecutionMode::SubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup"; + case ExecutionMode::SubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId"; + case ExecutionMode::LocalSizeId: return "LocalSizeId"; + case ExecutionMode::LocalSizeHintId: return "LocalSizeHintId"; + case ExecutionMode::NonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT"; + case ExecutionMode::NonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; + case ExecutionMode::NonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; + case ExecutionMode::SubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlowKHR"; + case ExecutionMode::PostDepthCoverage: return "PostDepthCoverage"; + case ExecutionMode::DenormPreserve: return "DenormPreserve"; + case ExecutionMode::DenormFlushToZero: return "DenormFlushToZero"; + case ExecutionMode::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case ExecutionMode::RoundingModeRTE: return "RoundingModeRTE"; + case ExecutionMode::RoundingModeRTZ: return "RoundingModeRTZ"; + case ExecutionMode::NonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM"; + case ExecutionMode::TileShadingRateQCOM: return "TileShadingRateQCOM"; + case ExecutionMode::EarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD"; + case ExecutionMode::StencilRefReplacingEXT: return "StencilRefReplacingEXT"; + case ExecutionMode::CoalescingAMDX: return "CoalescingAMDX"; + case ExecutionMode::IsApiEntryAMDX: return "IsApiEntryAMDX"; + case ExecutionMode::MaxNodeRecursionAMDX: return "MaxNodeRecursionAMDX"; + case ExecutionMode::StaticNumWorkgroupsAMDX: return "StaticNumWorkgroupsAMDX"; + case ExecutionMode::ShaderIndexAMDX: return "ShaderIndexAMDX"; + case ExecutionMode::MaxNumWorkgroupsAMDX: return "MaxNumWorkgroupsAMDX"; + case ExecutionMode::StencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD"; + case ExecutionMode::StencilRefGreaterFrontAMD: return "StencilRefGreaterFrontAMD"; + case ExecutionMode::StencilRefLessFrontAMD: return "StencilRefLessFrontAMD"; + case ExecutionMode::StencilRefUnchangedBackAMD: return "StencilRefUnchangedBackAMD"; + case ExecutionMode::StencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD"; + case ExecutionMode::StencilRefLessBackAMD: return "StencilRefLessBackAMD"; + case ExecutionMode::QuadDerivativesKHR: return "QuadDerivativesKHR"; + case ExecutionMode::RequireFullQuadsKHR: return "RequireFullQuadsKHR"; + case ExecutionMode::SharesInputWithAMDX: return "SharesInputWithAMDX"; + case ExecutionMode::OutputLinesEXT: return "OutputLinesEXT"; + case ExecutionMode::OutputPrimitivesEXT: return "OutputPrimitivesEXT"; + case ExecutionMode::DerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR"; + case ExecutionMode::DerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR"; + case ExecutionMode::OutputTrianglesEXT: return "OutputTrianglesEXT"; + case ExecutionMode::PixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT"; + case ExecutionMode::PixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT"; + case ExecutionMode::SampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT"; + case ExecutionMode::SampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT"; + case ExecutionMode::ShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT"; + case ExecutionMode::ShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT"; + case ExecutionMode::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT"; + case ExecutionMode::SharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL"; + case ExecutionMode::RoundingModeRTPINTEL: return "RoundingModeRTPINTEL"; + case ExecutionMode::RoundingModeRTNINTEL: return "RoundingModeRTNINTEL"; + case ExecutionMode::FloatingPointModeALTINTEL: return "FloatingPointModeALTINTEL"; + case ExecutionMode::FloatingPointModeIEEEINTEL: return "FloatingPointModeIEEEINTEL"; + case ExecutionMode::MaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL"; + case ExecutionMode::MaxWorkDimINTEL: return "MaxWorkDimINTEL"; + case ExecutionMode::NoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL"; + case ExecutionMode::NumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL"; + case ExecutionMode::SchedulerTargetFmaxMhzINTEL: return "SchedulerTargetFmaxMhzINTEL"; + case ExecutionMode::MaximallyReconvergesKHR: return "MaximallyReconvergesKHR"; + case ExecutionMode::FPFastMathDefault: return "FPFastMathDefault"; + case ExecutionMode::StreamingInterfaceINTEL: return "StreamingInterfaceINTEL"; + case ExecutionMode::RegisterMapInterfaceINTEL: return "RegisterMapInterfaceINTEL"; + case ExecutionMode::NamedBarrierCountINTEL: return "NamedBarrierCountINTEL"; + case ExecutionMode::MaximumRegistersINTEL: return "MaximumRegistersINTEL"; + case ExecutionMode::MaximumRegistersIdINTEL: return "MaximumRegistersIdINTEL"; + case ExecutionMode::NamedMaximumRegistersINTEL: return "NamedMaximumRegistersINTEL"; + default: return "Unknown"; + } +} + +inline const char* StorageClassToString(StorageClass value) { + switch (value) { + case StorageClass::UniformConstant: return "UniformConstant"; + case StorageClass::Input: return "Input"; + case StorageClass::Uniform: return "Uniform"; + case StorageClass::Output: return "Output"; + case StorageClass::Workgroup: return "Workgroup"; + case StorageClass::CrossWorkgroup: return "CrossWorkgroup"; + case StorageClass::Private: return "Private"; + case StorageClass::Function: return "Function"; + case StorageClass::Generic: return "Generic"; + case StorageClass::PushConstant: return "PushConstant"; + case StorageClass::AtomicCounter: return "AtomicCounter"; + case StorageClass::Image: return "Image"; + case StorageClass::StorageBuffer: return "StorageBuffer"; + case StorageClass::TileImageEXT: return "TileImageEXT"; + case StorageClass::TileAttachmentQCOM: return "TileAttachmentQCOM"; + case StorageClass::NodePayloadAMDX: return "NodePayloadAMDX"; + case StorageClass::CallableDataKHR: return "CallableDataKHR"; + case StorageClass::IncomingCallableDataKHR: return "IncomingCallableDataKHR"; + case StorageClass::RayPayloadKHR: return "RayPayloadKHR"; + case StorageClass::HitAttributeKHR: return "HitAttributeKHR"; + case StorageClass::IncomingRayPayloadKHR: return "IncomingRayPayloadKHR"; + case StorageClass::ShaderRecordBufferKHR: return "ShaderRecordBufferKHR"; + case StorageClass::PhysicalStorageBuffer: return "PhysicalStorageBuffer"; + case StorageClass::HitObjectAttributeNV: return "HitObjectAttributeNV"; + case StorageClass::TaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; + case StorageClass::HitObjectAttributeEXT: return "HitObjectAttributeEXT"; + case StorageClass::CodeSectionINTEL: return "CodeSectionINTEL"; + case StorageClass::DeviceOnlyINTEL: return "DeviceOnlyINTEL"; + case StorageClass::HostOnlyINTEL: return "HostOnlyINTEL"; + default: return "Unknown"; + } +} + +inline const char* DimToString(Dim value) { + switch (value) { + case Dim::Dim1D: return "1D"; + case Dim::Dim2D: return "2D"; + case Dim::Dim3D: return "3D"; + case Dim::Cube: return "Cube"; + case Dim::Rect: return "Rect"; + case Dim::Buffer: return "Buffer"; + case Dim::SubpassData: return "SubpassData"; + case Dim::TileImageDataEXT: return "TileImageDataEXT"; + default: return "Unknown"; + } +} + +inline const char* SamplerAddressingModeToString(SamplerAddressingMode value) { + switch (value) { + case SamplerAddressingMode::None: return "None"; + case SamplerAddressingMode::ClampToEdge: return "ClampToEdge"; + case SamplerAddressingMode::Clamp: return "Clamp"; + case SamplerAddressingMode::Repeat: return "Repeat"; + case SamplerAddressingMode::RepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* SamplerFilterModeToString(SamplerFilterMode value) { + switch (value) { + case SamplerFilterMode::Nearest: return "Nearest"; + case SamplerFilterMode::Linear: return "Linear"; + default: return "Unknown"; + } +} + +inline const char* ImageFormatToString(ImageFormat value) { + switch (value) { + case ImageFormat::Unknown: return "Unknown"; + case ImageFormat::Rgba32f: return "Rgba32f"; + case ImageFormat::Rgba16f: return "Rgba16f"; + case ImageFormat::R32f: return "R32f"; + case ImageFormat::Rgba8: return "Rgba8"; + case ImageFormat::Rgba8Snorm: return "Rgba8Snorm"; + case ImageFormat::Rg32f: return "Rg32f"; + case ImageFormat::Rg16f: return "Rg16f"; + case ImageFormat::R11fG11fB10f: return "R11fG11fB10f"; + case ImageFormat::R16f: return "R16f"; + case ImageFormat::Rgba16: return "Rgba16"; + case ImageFormat::Rgb10A2: return "Rgb10A2"; + case ImageFormat::Rg16: return "Rg16"; + case ImageFormat::Rg8: return "Rg8"; + case ImageFormat::R16: return "R16"; + case ImageFormat::R8: return "R8"; + case ImageFormat::Rgba16Snorm: return "Rgba16Snorm"; + case ImageFormat::Rg16Snorm: return "Rg16Snorm"; + case ImageFormat::Rg8Snorm: return "Rg8Snorm"; + case ImageFormat::R16Snorm: return "R16Snorm"; + case ImageFormat::R8Snorm: return "R8Snorm"; + case ImageFormat::Rgba32i: return "Rgba32i"; + case ImageFormat::Rgba16i: return "Rgba16i"; + case ImageFormat::Rgba8i: return "Rgba8i"; + case ImageFormat::R32i: return "R32i"; + case ImageFormat::Rg32i: return "Rg32i"; + case ImageFormat::Rg16i: return "Rg16i"; + case ImageFormat::Rg8i: return "Rg8i"; + case ImageFormat::R16i: return "R16i"; + case ImageFormat::R8i: return "R8i"; + case ImageFormat::Rgba32ui: return "Rgba32ui"; + case ImageFormat::Rgba16ui: return "Rgba16ui"; + case ImageFormat::Rgba8ui: return "Rgba8ui"; + case ImageFormat::R32ui: return "R32ui"; + case ImageFormat::Rgb10a2ui: return "Rgb10a2ui"; + case ImageFormat::Rg32ui: return "Rg32ui"; + case ImageFormat::Rg16ui: return "Rg16ui"; + case ImageFormat::Rg8ui: return "Rg8ui"; + case ImageFormat::R16ui: return "R16ui"; + case ImageFormat::R8ui: return "R8ui"; + case ImageFormat::R64ui: return "R64ui"; + case ImageFormat::R64i: return "R64i"; + default: return "Unknown"; + } +} + +inline const char* ImageChannelOrderToString(ImageChannelOrder value) { + switch (value) { + case ImageChannelOrder::R: return "R"; + case ImageChannelOrder::A: return "A"; + case ImageChannelOrder::RG: return "RG"; + case ImageChannelOrder::RA: return "RA"; + case ImageChannelOrder::RGB: return "RGB"; + case ImageChannelOrder::RGBA: return "RGBA"; + case ImageChannelOrder::BGRA: return "BGRA"; + case ImageChannelOrder::ARGB: return "ARGB"; + case ImageChannelOrder::Intensity: return "Intensity"; + case ImageChannelOrder::Luminance: return "Luminance"; + case ImageChannelOrder::Rx: return "Rx"; + case ImageChannelOrder::RGx: return "RGx"; + case ImageChannelOrder::RGBx: return "RGBx"; + case ImageChannelOrder::Depth: return "Depth"; + case ImageChannelOrder::DepthStencil: return "DepthStencil"; + case ImageChannelOrder::sRGB: return "sRGB"; + case ImageChannelOrder::sRGBx: return "sRGBx"; + case ImageChannelOrder::sRGBA: return "sRGBA"; + case ImageChannelOrder::sBGRA: return "sBGRA"; + case ImageChannelOrder::ABGR: return "ABGR"; + default: return "Unknown"; + } +} + +inline const char* ImageChannelDataTypeToString(ImageChannelDataType value) { + switch (value) { + case ImageChannelDataType::SnormInt8: return "SnormInt8"; + case ImageChannelDataType::SnormInt16: return "SnormInt16"; + case ImageChannelDataType::UnormInt8: return "UnormInt8"; + case ImageChannelDataType::UnormInt16: return "UnormInt16"; + case ImageChannelDataType::UnormShort565: return "UnormShort565"; + case ImageChannelDataType::UnormShort555: return "UnormShort555"; + case ImageChannelDataType::UnormInt101010: return "UnormInt101010"; + case ImageChannelDataType::SignedInt8: return "SignedInt8"; + case ImageChannelDataType::SignedInt16: return "SignedInt16"; + case ImageChannelDataType::SignedInt32: return "SignedInt32"; + case ImageChannelDataType::UnsignedInt8: return "UnsignedInt8"; + case ImageChannelDataType::UnsignedInt16: return "UnsignedInt16"; + case ImageChannelDataType::UnsignedInt32: return "UnsignedInt32"; + case ImageChannelDataType::HalfFloat: return "HalfFloat"; + case ImageChannelDataType::Float: return "Float"; + case ImageChannelDataType::UnormInt24: return "UnormInt24"; + case ImageChannelDataType::UnormInt101010_2: return "UnormInt101010_2"; + case ImageChannelDataType::UnsignedIntRaw10EXT: return "UnsignedIntRaw10EXT"; + case ImageChannelDataType::UnsignedIntRaw12EXT: return "UnsignedIntRaw12EXT"; + case ImageChannelDataType::UnormInt2_101010EXT: return "UnormInt2_101010EXT"; + default: return "Unknown"; + } +} + +inline const char* FPRoundingModeToString(FPRoundingMode value) { + switch (value) { + case FPRoundingMode::RTE: return "RTE"; + case FPRoundingMode::RTZ: return "RTZ"; + case FPRoundingMode::RTP: return "RTP"; + case FPRoundingMode::RTN: return "RTN"; + default: return "Unknown"; + } +} + +inline const char* LinkageTypeToString(LinkageType value) { + switch (value) { + case LinkageType::Export: return "Export"; + case LinkageType::Import: return "Import"; + case LinkageType::LinkOnceODR: return "LinkOnceODR"; + default: return "Unknown"; + } +} + +inline const char* AccessQualifierToString(AccessQualifier value) { + switch (value) { + case AccessQualifier::ReadOnly: return "ReadOnly"; + case AccessQualifier::WriteOnly: return "WriteOnly"; + case AccessQualifier::ReadWrite: return "ReadWrite"; + default: return "Unknown"; + } +} + +inline const char* FunctionParameterAttributeToString(FunctionParameterAttribute value) { + switch (value) { + case FunctionParameterAttribute::Zext: return "Zext"; + case FunctionParameterAttribute::Sext: return "Sext"; + case FunctionParameterAttribute::ByVal: return "ByVal"; + case FunctionParameterAttribute::Sret: return "Sret"; + case FunctionParameterAttribute::NoAlias: return "NoAlias"; + case FunctionParameterAttribute::NoCapture: return "NoCapture"; + case FunctionParameterAttribute::NoWrite: return "NoWrite"; + case FunctionParameterAttribute::NoReadWrite: return "NoReadWrite"; + case FunctionParameterAttribute::RuntimeAlignedINTEL: return "RuntimeAlignedINTEL"; + default: return "Unknown"; + } +} + +inline const char* DecorationToString(Decoration value) { + switch (value) { + case Decoration::RelaxedPrecision: return "RelaxedPrecision"; + case Decoration::SpecId: return "SpecId"; + case Decoration::Block: return "Block"; + case Decoration::BufferBlock: return "BufferBlock"; + case Decoration::RowMajor: return "RowMajor"; + case Decoration::ColMajor: return "ColMajor"; + case Decoration::ArrayStride: return "ArrayStride"; + case Decoration::MatrixStride: return "MatrixStride"; + case Decoration::GLSLShared: return "GLSLShared"; + case Decoration::GLSLPacked: return "GLSLPacked"; + case Decoration::CPacked: return "CPacked"; + case Decoration::BuiltIn: return "BuiltIn"; + case Decoration::NoPerspective: return "NoPerspective"; + case Decoration::Flat: return "Flat"; + case Decoration::Patch: return "Patch"; + case Decoration::Centroid: return "Centroid"; + case Decoration::Sample: return "Sample"; + case Decoration::Invariant: return "Invariant"; + case Decoration::Restrict: return "Restrict"; + case Decoration::Aliased: return "Aliased"; + case Decoration::Volatile: return "Volatile"; + case Decoration::Constant: return "Constant"; + case Decoration::Coherent: return "Coherent"; + case Decoration::NonWritable: return "NonWritable"; + case Decoration::NonReadable: return "NonReadable"; + case Decoration::Uniform: return "Uniform"; + case Decoration::UniformId: return "UniformId"; + case Decoration::SaturatedConversion: return "SaturatedConversion"; + case Decoration::Stream: return "Stream"; + case Decoration::Location: return "Location"; + case Decoration::Component: return "Component"; + case Decoration::Index: return "Index"; + case Decoration::Binding: return "Binding"; + case Decoration::DescriptorSet: return "DescriptorSet"; + case Decoration::Offset: return "Offset"; + case Decoration::XfbBuffer: return "XfbBuffer"; + case Decoration::XfbStride: return "XfbStride"; + case Decoration::FuncParamAttr: return "FuncParamAttr"; + case Decoration::FPRoundingMode: return "FPRoundingMode"; + case Decoration::FPFastMathMode: return "FPFastMathMode"; + case Decoration::LinkageAttributes: return "LinkageAttributes"; + case Decoration::NoContraction: return "NoContraction"; + case Decoration::InputAttachmentIndex: return "InputAttachmentIndex"; + case Decoration::Alignment: return "Alignment"; + case Decoration::MaxByteOffset: return "MaxByteOffset"; + case Decoration::AlignmentId: return "AlignmentId"; + case Decoration::MaxByteOffsetId: return "MaxByteOffsetId"; + case Decoration::SaturatedToLargestFloat8NormalConversionEXT: return "SaturatedToLargestFloat8NormalConversionEXT"; + case Decoration::NoSignedWrap: return "NoSignedWrap"; + case Decoration::NoUnsignedWrap: return "NoUnsignedWrap"; + case Decoration::WeightTextureQCOM: return "WeightTextureQCOM"; + case Decoration::BlockMatchTextureQCOM: return "BlockMatchTextureQCOM"; + case Decoration::BlockMatchSamplerQCOM: return "BlockMatchSamplerQCOM"; + case Decoration::ExplicitInterpAMD: return "ExplicitInterpAMD"; + case Decoration::NodeSharesPayloadLimitsWithAMDX: return "NodeSharesPayloadLimitsWithAMDX"; + case Decoration::NodeMaxPayloadsAMDX: return "NodeMaxPayloadsAMDX"; + case Decoration::TrackFinishWritingAMDX: return "TrackFinishWritingAMDX"; + case Decoration::PayloadNodeNameAMDX: return "PayloadNodeNameAMDX"; + case Decoration::PayloadNodeBaseIndexAMDX: return "PayloadNodeBaseIndexAMDX"; + case Decoration::PayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX"; + case Decoration::PayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX"; + case Decoration::PayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX"; + case Decoration::OverrideCoverageNV: return "OverrideCoverageNV"; + case Decoration::PassthroughNV: return "PassthroughNV"; + case Decoration::ViewportRelativeNV: return "ViewportRelativeNV"; + case Decoration::SecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV"; + case Decoration::PerPrimitiveEXT: return "PerPrimitiveEXT"; + case Decoration::PerViewNV: return "PerViewNV"; + case Decoration::PerTaskNV: return "PerTaskNV"; + case Decoration::PerVertexKHR: return "PerVertexKHR"; + case Decoration::NonUniform: return "NonUniform"; + case Decoration::RestrictPointer: return "RestrictPointer"; + case Decoration::AliasedPointer: return "AliasedPointer"; + case Decoration::HitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV"; + case Decoration::HitObjectShaderRecordBufferEXT: return "HitObjectShaderRecordBufferEXT"; + case Decoration::BindlessSamplerNV: return "BindlessSamplerNV"; + case Decoration::BindlessImageNV: return "BindlessImageNV"; + case Decoration::BoundSamplerNV: return "BoundSamplerNV"; + case Decoration::BoundImageNV: return "BoundImageNV"; + case Decoration::SIMTCallINTEL: return "SIMTCallINTEL"; + case Decoration::ReferencedIndirectlyINTEL: return "ReferencedIndirectlyINTEL"; + case Decoration::ClobberINTEL: return "ClobberINTEL"; + case Decoration::SideEffectsINTEL: return "SideEffectsINTEL"; + case Decoration::VectorComputeVariableINTEL: return "VectorComputeVariableINTEL"; + case Decoration::FuncParamIOKindINTEL: return "FuncParamIOKindINTEL"; + case Decoration::VectorComputeFunctionINTEL: return "VectorComputeFunctionINTEL"; + case Decoration::StackCallINTEL: return "StackCallINTEL"; + case Decoration::GlobalVariableOffsetINTEL: return "GlobalVariableOffsetINTEL"; + case Decoration::CounterBuffer: return "CounterBuffer"; + case Decoration::HlslSemanticGOOGLE: return "HlslSemanticGOOGLE"; + case Decoration::UserTypeGOOGLE: return "UserTypeGOOGLE"; + case Decoration::FunctionRoundingModeINTEL: return "FunctionRoundingModeINTEL"; + case Decoration::FunctionDenormModeINTEL: return "FunctionDenormModeINTEL"; + case Decoration::RegisterINTEL: return "RegisterINTEL"; + case Decoration::MemoryINTEL: return "MemoryINTEL"; + case Decoration::NumbanksINTEL: return "NumbanksINTEL"; + case Decoration::BankwidthINTEL: return "BankwidthINTEL"; + case Decoration::MaxPrivateCopiesINTEL: return "MaxPrivateCopiesINTEL"; + case Decoration::SinglepumpINTEL: return "SinglepumpINTEL"; + case Decoration::DoublepumpINTEL: return "DoublepumpINTEL"; + case Decoration::MaxReplicatesINTEL: return "MaxReplicatesINTEL"; + case Decoration::SimpleDualPortINTEL: return "SimpleDualPortINTEL"; + case Decoration::MergeINTEL: return "MergeINTEL"; + case Decoration::BankBitsINTEL: return "BankBitsINTEL"; + case Decoration::ForcePow2DepthINTEL: return "ForcePow2DepthINTEL"; + case Decoration::StridesizeINTEL: return "StridesizeINTEL"; + case Decoration::WordsizeINTEL: return "WordsizeINTEL"; + case Decoration::TrueDualPortINTEL: return "TrueDualPortINTEL"; + case Decoration::BurstCoalesceINTEL: return "BurstCoalesceINTEL"; + case Decoration::CacheSizeINTEL: return "CacheSizeINTEL"; + case Decoration::DontStaticallyCoalesceINTEL: return "DontStaticallyCoalesceINTEL"; + case Decoration::PrefetchINTEL: return "PrefetchINTEL"; + case Decoration::StallEnableINTEL: return "StallEnableINTEL"; + case Decoration::FuseLoopsInFunctionINTEL: return "FuseLoopsInFunctionINTEL"; + case Decoration::MathOpDSPModeINTEL: return "MathOpDSPModeINTEL"; + case Decoration::AliasScopeINTEL: return "AliasScopeINTEL"; + case Decoration::NoAliasINTEL: return "NoAliasINTEL"; + case Decoration::InitiationIntervalINTEL: return "InitiationIntervalINTEL"; + case Decoration::MaxConcurrencyINTEL: return "MaxConcurrencyINTEL"; + case Decoration::PipelineEnableINTEL: return "PipelineEnableINTEL"; + case Decoration::BufferLocationINTEL: return "BufferLocationINTEL"; + case Decoration::IOPipeStorageINTEL: return "IOPipeStorageINTEL"; + case Decoration::FunctionFloatingPointModeINTEL: return "FunctionFloatingPointModeINTEL"; + case Decoration::SingleElementVectorINTEL: return "SingleElementVectorINTEL"; + case Decoration::VectorComputeCallableFunctionINTEL: return "VectorComputeCallableFunctionINTEL"; + case Decoration::MediaBlockIOINTEL: return "MediaBlockIOINTEL"; + case Decoration::StallFreeINTEL: return "StallFreeINTEL"; + case Decoration::FPMaxErrorDecorationINTEL: return "FPMaxErrorDecorationINTEL"; + case Decoration::LatencyControlLabelINTEL: return "LatencyControlLabelINTEL"; + case Decoration::LatencyControlConstraintINTEL: return "LatencyControlConstraintINTEL"; + case Decoration::ConduitKernelArgumentINTEL: return "ConduitKernelArgumentINTEL"; + case Decoration::RegisterMapKernelArgumentINTEL: return "RegisterMapKernelArgumentINTEL"; + case Decoration::MMHostInterfaceAddressWidthINTEL: return "MMHostInterfaceAddressWidthINTEL"; + case Decoration::MMHostInterfaceDataWidthINTEL: return "MMHostInterfaceDataWidthINTEL"; + case Decoration::MMHostInterfaceLatencyINTEL: return "MMHostInterfaceLatencyINTEL"; + case Decoration::MMHostInterfaceReadWriteModeINTEL: return "MMHostInterfaceReadWriteModeINTEL"; + case Decoration::MMHostInterfaceMaxBurstINTEL: return "MMHostInterfaceMaxBurstINTEL"; + case Decoration::MMHostInterfaceWaitRequestINTEL: return "MMHostInterfaceWaitRequestINTEL"; + case Decoration::StableKernelArgumentINTEL: return "StableKernelArgumentINTEL"; + case Decoration::HostAccessINTEL: return "HostAccessINTEL"; + case Decoration::InitModeINTEL: return "InitModeINTEL"; + case Decoration::ImplementInRegisterMapINTEL: return "ImplementInRegisterMapINTEL"; + case Decoration::CacheControlLoadINTEL: return "CacheControlLoadINTEL"; + case Decoration::CacheControlStoreINTEL: return "CacheControlStoreINTEL"; + default: return "Unknown"; + } +} + +inline const char* BuiltInToString(BuiltIn value) { + switch (value) { + case BuiltIn::Position: return "Position"; + case BuiltIn::PointSize: return "PointSize"; + case BuiltIn::ClipDistance: return "ClipDistance"; + case BuiltIn::CullDistance: return "CullDistance"; + case BuiltIn::VertexId: return "VertexId"; + case BuiltIn::InstanceId: return "InstanceId"; + case BuiltIn::PrimitiveId: return "PrimitiveId"; + case BuiltIn::InvocationId: return "InvocationId"; + case BuiltIn::Layer: return "Layer"; + case BuiltIn::ViewportIndex: return "ViewportIndex"; + case BuiltIn::TessLevelOuter: return "TessLevelOuter"; + case BuiltIn::TessLevelInner: return "TessLevelInner"; + case BuiltIn::TessCoord: return "TessCoord"; + case BuiltIn::PatchVertices: return "PatchVertices"; + case BuiltIn::FragCoord: return "FragCoord"; + case BuiltIn::PointCoord: return "PointCoord"; + case BuiltIn::FrontFacing: return "FrontFacing"; + case BuiltIn::SampleId: return "SampleId"; + case BuiltIn::SamplePosition: return "SamplePosition"; + case BuiltIn::SampleMask: return "SampleMask"; + case BuiltIn::FragDepth: return "FragDepth"; + case BuiltIn::HelperInvocation: return "HelperInvocation"; + case BuiltIn::NumWorkgroups: return "NumWorkgroups"; + case BuiltIn::WorkgroupSize: return "WorkgroupSize"; + case BuiltIn::WorkgroupId: return "WorkgroupId"; + case BuiltIn::LocalInvocationId: return "LocalInvocationId"; + case BuiltIn::GlobalInvocationId: return "GlobalInvocationId"; + case BuiltIn::LocalInvocationIndex: return "LocalInvocationIndex"; + case BuiltIn::WorkDim: return "WorkDim"; + case BuiltIn::GlobalSize: return "GlobalSize"; + case BuiltIn::EnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize"; + case BuiltIn::GlobalOffset: return "GlobalOffset"; + case BuiltIn::GlobalLinearId: return "GlobalLinearId"; + case BuiltIn::SubgroupSize: return "SubgroupSize"; + case BuiltIn::SubgroupMaxSize: return "SubgroupMaxSize"; + case BuiltIn::NumSubgroups: return "NumSubgroups"; + case BuiltIn::NumEnqueuedSubgroups: return "NumEnqueuedSubgroups"; + case BuiltIn::SubgroupId: return "SubgroupId"; + case BuiltIn::SubgroupLocalInvocationId: return "SubgroupLocalInvocationId"; + case BuiltIn::VertexIndex: return "VertexIndex"; + case BuiltIn::InstanceIndex: return "InstanceIndex"; + case BuiltIn::CoreIDARM: return "CoreIDARM"; + case BuiltIn::CoreCountARM: return "CoreCountARM"; + case BuiltIn::CoreMaxIDARM: return "CoreMaxIDARM"; + case BuiltIn::WarpIDARM: return "WarpIDARM"; + case BuiltIn::WarpMaxIDARM: return "WarpMaxIDARM"; + case BuiltIn::SubgroupEqMask: return "SubgroupEqMask"; + case BuiltIn::SubgroupGeMask: return "SubgroupGeMask"; + case BuiltIn::SubgroupGtMask: return "SubgroupGtMask"; + case BuiltIn::SubgroupLeMask: return "SubgroupLeMask"; + case BuiltIn::SubgroupLtMask: return "SubgroupLtMask"; + case BuiltIn::BaseVertex: return "BaseVertex"; + case BuiltIn::BaseInstance: return "BaseInstance"; + case BuiltIn::DrawIndex: return "DrawIndex"; + case BuiltIn::PrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR"; + case BuiltIn::DeviceIndex: return "DeviceIndex"; + case BuiltIn::ViewIndex: return "ViewIndex"; + case BuiltIn::ShadingRateKHR: return "ShadingRateKHR"; + case BuiltIn::TileOffsetQCOM: return "TileOffsetQCOM"; + case BuiltIn::TileDimensionQCOM: return "TileDimensionQCOM"; + case BuiltIn::TileApronSizeQCOM: return "TileApronSizeQCOM"; + case BuiltIn::BaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD"; + case BuiltIn::BaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD"; + case BuiltIn::BaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD"; + case BuiltIn::BaryCoordSmoothAMD: return "BaryCoordSmoothAMD"; + case BuiltIn::BaryCoordSmoothCentroidAMD: return "BaryCoordSmoothCentroidAMD"; + case BuiltIn::BaryCoordSmoothSampleAMD: return "BaryCoordSmoothSampleAMD"; + case BuiltIn::BaryCoordPullModelAMD: return "BaryCoordPullModelAMD"; + case BuiltIn::FragStencilRefEXT: return "FragStencilRefEXT"; + case BuiltIn::RemainingRecursionLevelsAMDX: return "RemainingRecursionLevelsAMDX"; + case BuiltIn::ShaderIndexAMDX: return "ShaderIndexAMDX"; + case BuiltIn::ViewportMaskNV: return "ViewportMaskNV"; + case BuiltIn::SecondaryPositionNV: return "SecondaryPositionNV"; + case BuiltIn::SecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case BuiltIn::PositionPerViewNV: return "PositionPerViewNV"; + case BuiltIn::ViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case BuiltIn::FullyCoveredEXT: return "FullyCoveredEXT"; + case BuiltIn::TaskCountNV: return "TaskCountNV"; + case BuiltIn::PrimitiveCountNV: return "PrimitiveCountNV"; + case BuiltIn::PrimitiveIndicesNV: return "PrimitiveIndicesNV"; + case BuiltIn::ClipDistancePerViewNV: return "ClipDistancePerViewNV"; + case BuiltIn::CullDistancePerViewNV: return "CullDistancePerViewNV"; + case BuiltIn::LayerPerViewNV: return "LayerPerViewNV"; + case BuiltIn::MeshViewCountNV: return "MeshViewCountNV"; + case BuiltIn::MeshViewIndicesNV: return "MeshViewIndicesNV"; + case BuiltIn::BaryCoordKHR: return "BaryCoordKHR"; + case BuiltIn::BaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR"; + case BuiltIn::FragSizeEXT: return "FragSizeEXT"; + case BuiltIn::FragInvocationCountEXT: return "FragInvocationCountEXT"; + case BuiltIn::PrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT"; + case BuiltIn::PrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT"; + case BuiltIn::PrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT"; + case BuiltIn::CullPrimitiveEXT: return "CullPrimitiveEXT"; + case BuiltIn::LaunchIdKHR: return "LaunchIdKHR"; + case BuiltIn::LaunchSizeKHR: return "LaunchSizeKHR"; + case BuiltIn::WorldRayOriginKHR: return "WorldRayOriginKHR"; + case BuiltIn::WorldRayDirectionKHR: return "WorldRayDirectionKHR"; + case BuiltIn::ObjectRayOriginKHR: return "ObjectRayOriginKHR"; + case BuiltIn::ObjectRayDirectionKHR: return "ObjectRayDirectionKHR"; + case BuiltIn::RayTminKHR: return "RayTminKHR"; + case BuiltIn::RayTmaxKHR: return "RayTmaxKHR"; + case BuiltIn::InstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; + case BuiltIn::ObjectToWorldKHR: return "ObjectToWorldKHR"; + case BuiltIn::WorldToObjectKHR: return "WorldToObjectKHR"; + case BuiltIn::HitTNV: return "HitTNV"; + case BuiltIn::HitKindKHR: return "HitKindKHR"; + case BuiltIn::CurrentRayTimeNV: return "CurrentRayTimeNV"; + case BuiltIn::HitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; + case BuiltIn::HitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV"; + case BuiltIn::HitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV"; + case BuiltIn::IncomingRayFlagsKHR: return "IncomingRayFlagsKHR"; + case BuiltIn::RayGeometryIndexKHR: return "RayGeometryIndexKHR"; + case BuiltIn::HitIsSphereNV: return "HitIsSphereNV"; + case BuiltIn::HitIsLSSNV: return "HitIsLSSNV"; + case BuiltIn::HitSpherePositionNV: return "HitSpherePositionNV"; + case BuiltIn::WarpsPerSMNV: return "WarpsPerSMNV"; + case BuiltIn::SMCountNV: return "SMCountNV"; + case BuiltIn::WarpIDNV: return "WarpIDNV"; + case BuiltIn::SMIDNV: return "SMIDNV"; + case BuiltIn::HitLSSPositionsNV: return "HitLSSPositionsNV"; + case BuiltIn::HitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case BuiltIn::HitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + case BuiltIn::HitSphereRadiusNV: return "HitSphereRadiusNV"; + case BuiltIn::HitLSSRadiiNV: return "HitLSSRadiiNV"; + case BuiltIn::ClusterIDNV: return "ClusterIDNV"; + case BuiltIn::CullMaskKHR: return "CullMaskKHR"; + default: return "Unknown"; + } +} + +inline const char* ScopeToString(Scope value) { + switch (value) { + case Scope::CrossDevice: return "CrossDevice"; + case Scope::Device: return "Device"; + case Scope::Workgroup: return "Workgroup"; + case Scope::Subgroup: return "Subgroup"; + case Scope::Invocation: return "Invocation"; + case Scope::QueueFamily: return "QueueFamily"; + case Scope::ShaderCallKHR: return "ShaderCallKHR"; + default: return "Unknown"; + } +} + +inline const char* GroupOperationToString(GroupOperation value) { + switch (value) { + case GroupOperation::Reduce: return "Reduce"; + case GroupOperation::InclusiveScan: return "InclusiveScan"; + case GroupOperation::ExclusiveScan: return "ExclusiveScan"; + case GroupOperation::ClusteredReduce: return "ClusteredReduce"; + case GroupOperation::PartitionedReduceNV: return "PartitionedReduceNV"; + case GroupOperation::PartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV"; + case GroupOperation::PartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV"; + default: return "Unknown"; + } +} + +inline const char* KernelEnqueueFlagsToString(KernelEnqueueFlags value) { + switch (value) { + case KernelEnqueueFlags::NoWait: return "NoWait"; + case KernelEnqueueFlags::WaitKernel: return "WaitKernel"; + case KernelEnqueueFlags::WaitWorkGroup: return "WaitWorkGroup"; + default: return "Unknown"; + } +} + +inline const char* CapabilityToString(Capability value) { + switch (value) { + case Capability::Matrix: return "Matrix"; + case Capability::Shader: return "Shader"; + case Capability::Geometry: return "Geometry"; + case Capability::Tessellation: return "Tessellation"; + case Capability::Addresses: return "Addresses"; + case Capability::Linkage: return "Linkage"; + case Capability::Kernel: return "Kernel"; + case Capability::Vector16: return "Vector16"; + case Capability::Float16Buffer: return "Float16Buffer"; + case Capability::Float16: return "Float16"; + case Capability::Float64: return "Float64"; + case Capability::Int64: return "Int64"; + case Capability::Int64Atomics: return "Int64Atomics"; + case Capability::ImageBasic: return "ImageBasic"; + case Capability::ImageReadWrite: return "ImageReadWrite"; + case Capability::ImageMipmap: return "ImageMipmap"; + case Capability::Pipes: return "Pipes"; + case Capability::Groups: return "Groups"; + case Capability::DeviceEnqueue: return "DeviceEnqueue"; + case Capability::LiteralSampler: return "LiteralSampler"; + case Capability::AtomicStorage: return "AtomicStorage"; + case Capability::Int16: return "Int16"; + case Capability::TessellationPointSize: return "TessellationPointSize"; + case Capability::GeometryPointSize: return "GeometryPointSize"; + case Capability::ImageGatherExtended: return "ImageGatherExtended"; + case Capability::StorageImageMultisample: return "StorageImageMultisample"; + case Capability::UniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing"; + case Capability::SampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing"; + case Capability::StorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing"; + case Capability::StorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing"; + case Capability::ClipDistance: return "ClipDistance"; + case Capability::CullDistance: return "CullDistance"; + case Capability::ImageCubeArray: return "ImageCubeArray"; + case Capability::SampleRateShading: return "SampleRateShading"; + case Capability::ImageRect: return "ImageRect"; + case Capability::SampledRect: return "SampledRect"; + case Capability::GenericPointer: return "GenericPointer"; + case Capability::Int8: return "Int8"; + case Capability::InputAttachment: return "InputAttachment"; + case Capability::SparseResidency: return "SparseResidency"; + case Capability::MinLod: return "MinLod"; + case Capability::Sampled1D: return "Sampled1D"; + case Capability::Image1D: return "Image1D"; + case Capability::SampledCubeArray: return "SampledCubeArray"; + case Capability::SampledBuffer: return "SampledBuffer"; + case Capability::ImageBuffer: return "ImageBuffer"; + case Capability::ImageMSArray: return "ImageMSArray"; + case Capability::StorageImageExtendedFormats: return "StorageImageExtendedFormats"; + case Capability::ImageQuery: return "ImageQuery"; + case Capability::DerivativeControl: return "DerivativeControl"; + case Capability::InterpolationFunction: return "InterpolationFunction"; + case Capability::TransformFeedback: return "TransformFeedback"; + case Capability::GeometryStreams: return "GeometryStreams"; + case Capability::StorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat"; + case Capability::StorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat"; + case Capability::MultiViewport: return "MultiViewport"; + case Capability::SubgroupDispatch: return "SubgroupDispatch"; + case Capability::NamedBarrier: return "NamedBarrier"; + case Capability::PipeStorage: return "PipeStorage"; + case Capability::GroupNonUniform: return "GroupNonUniform"; + case Capability::GroupNonUniformVote: return "GroupNonUniformVote"; + case Capability::GroupNonUniformArithmetic: return "GroupNonUniformArithmetic"; + case Capability::GroupNonUniformBallot: return "GroupNonUniformBallot"; + case Capability::GroupNonUniformShuffle: return "GroupNonUniformShuffle"; + case Capability::GroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative"; + case Capability::GroupNonUniformClustered: return "GroupNonUniformClustered"; + case Capability::GroupNonUniformQuad: return "GroupNonUniformQuad"; + case Capability::ShaderLayer: return "ShaderLayer"; + case Capability::ShaderViewportIndex: return "ShaderViewportIndex"; + case Capability::UniformDecoration: return "UniformDecoration"; + case Capability::CoreBuiltinsARM: return "CoreBuiltinsARM"; + case Capability::TileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; + case Capability::TileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; + case Capability::TileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case Capability::TensorsARM: return "TensorsARM"; + case Capability::CooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; + case Capability::Float8EXT: return "Float8EXT"; + case Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT"; + case Capability::FragmentShadingRateKHR: return "FragmentShadingRateKHR"; + case Capability::SubgroupBallotKHR: return "SubgroupBallotKHR"; + case Capability::DrawParameters: return "DrawParameters"; + case Capability::WorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR"; + case Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR"; + case Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR"; + case Capability::SubgroupVoteKHR: return "SubgroupVoteKHR"; + case Capability::StorageBuffer16BitAccess: return "StorageBuffer16BitAccess"; + case Capability::StorageUniform16: return "StorageUniform16"; + case Capability::StoragePushConstant16: return "StoragePushConstant16"; + case Capability::StorageInputOutput16: return "StorageInputOutput16"; + case Capability::DeviceGroup: return "DeviceGroup"; + case Capability::MultiView: return "MultiView"; + case Capability::VariablePointersStorageBuffer: return "VariablePointersStorageBuffer"; + case Capability::VariablePointers: return "VariablePointers"; + case Capability::AtomicStorageOps: return "AtomicStorageOps"; + case Capability::SampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage"; + case Capability::StorageBuffer8BitAccess: return "StorageBuffer8BitAccess"; + case Capability::UniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess"; + case Capability::StoragePushConstant8: return "StoragePushConstant8"; + case Capability::DenormPreserve: return "DenormPreserve"; + case Capability::DenormFlushToZero: return "DenormFlushToZero"; + case Capability::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case Capability::RoundingModeRTE: return "RoundingModeRTE"; + case Capability::RoundingModeRTZ: return "RoundingModeRTZ"; + case Capability::RayQueryProvisionalKHR: return "RayQueryProvisionalKHR"; + case Capability::RayQueryKHR: return "RayQueryKHR"; + case Capability::UntypedPointersKHR: return "UntypedPointersKHR"; + case Capability::RayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; + case Capability::RayTracingKHR: return "RayTracingKHR"; + case Capability::TextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; + case Capability::TextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; + case Capability::TextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + case Capability::TileShadingQCOM: return "TileShadingQCOM"; + case Capability::CooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM"; + case Capability::TextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; + case Capability::Float16ImageAMD: return "Float16ImageAMD"; + case Capability::ImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; + case Capability::FragmentMaskAMD: return "FragmentMaskAMD"; + case Capability::StencilExportEXT: return "StencilExportEXT"; + case Capability::ImageReadWriteLodAMD: return "ImageReadWriteLodAMD"; + case Capability::Int64ImageEXT: return "Int64ImageEXT"; + case Capability::ShaderClockKHR: return "ShaderClockKHR"; + case Capability::ShaderEnqueueAMDX: return "ShaderEnqueueAMDX"; + case Capability::QuadControlKHR: return "QuadControlKHR"; + case Capability::BFloat16TypeKHR: return "BFloat16TypeKHR"; + case Capability::BFloat16DotProductKHR: return "BFloat16DotProductKHR"; + case Capability::BFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR"; + case Capability::SampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; + case Capability::GeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; + case Capability::ShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT"; + case Capability::ShaderViewportMaskNV: return "ShaderViewportMaskNV"; + case Capability::ShaderStereoViewNV: return "ShaderStereoViewNV"; + case Capability::PerViewAttributesNV: return "PerViewAttributesNV"; + case Capability::FragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT"; + case Capability::MeshShadingNV: return "MeshShadingNV"; + case Capability::ImageFootprintNV: return "ImageFootprintNV"; + case Capability::MeshShadingEXT: return "MeshShadingEXT"; + case Capability::FragmentBarycentricKHR: return "FragmentBarycentricKHR"; + case Capability::ComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR"; + case Capability::FragmentDensityEXT: return "FragmentDensityEXT"; + case Capability::GroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; + case Capability::ShaderNonUniform: return "ShaderNonUniform"; + case Capability::RuntimeDescriptorArray: return "RuntimeDescriptorArray"; + case Capability::InputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing"; + case Capability::UniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing"; + case Capability::StorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing"; + case Capability::UniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing"; + case Capability::SampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing"; + case Capability::StorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing"; + case Capability::StorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing"; + case Capability::InputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing"; + case Capability::UniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing"; + case Capability::StorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing"; + case Capability::RayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case Capability::RayTracingNV: return "RayTracingNV"; + case Capability::RayTracingMotionBlurNV: return "RayTracingMotionBlurNV"; + case Capability::VulkanMemoryModel: return "VulkanMemoryModel"; + case Capability::VulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope"; + case Capability::PhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses"; + case Capability::ComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR"; + case Capability::RayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; + case Capability::CooperativeMatrixNV: return "CooperativeMatrixNV"; + case Capability::FragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT"; + case Capability::FragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT"; + case Capability::ShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV"; + case Capability::FragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT"; + case Capability::DemoteToHelperInvocation: return "DemoteToHelperInvocation"; + case Capability::DisplacementMicromapNV: return "DisplacementMicromapNV"; + case Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; + case Capability::ShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + case Capability::ShaderInvocationReorderEXT: return "ShaderInvocationReorderEXT"; + case Capability::BindlessTextureNV: return "BindlessTextureNV"; + case Capability::RayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; + case Capability::CooperativeVectorNV: return "CooperativeVectorNV"; + case Capability::AtomicFloat16VectorNV: return "AtomicFloat16VectorNV"; + case Capability::RayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV"; + case Capability::RawAccessChainsNV: return "RawAccessChainsNV"; + case Capability::RayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV"; + case Capability::RayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV"; + case Capability::LongVectorEXT: return "LongVectorEXT"; + case Capability::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT"; + case Capability::CooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV"; + case Capability::CooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV"; + case Capability::CooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV"; + case Capability::CooperativeMatrixTensorAddressingNV: return "CooperativeMatrixTensorAddressingNV"; + case Capability::CooperativeMatrixBlockLoadsNV: return "CooperativeMatrixBlockLoadsNV"; + case Capability::CooperativeVectorTrainingNV: return "CooperativeVectorTrainingNV"; + case Capability::RayTracingClusterAccelerationStructureNV: return "RayTracingClusterAccelerationStructureNV"; + case Capability::TensorAddressingNV: return "TensorAddressingNV"; + case Capability::SubgroupShuffleINTEL: return "SubgroupShuffleINTEL"; + case Capability::SubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL"; + case Capability::SubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL"; + case Capability::SubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL"; + case Capability::RoundToInfinityINTEL: return "RoundToInfinityINTEL"; + case Capability::FloatingPointModeINTEL: return "FloatingPointModeINTEL"; + case Capability::IntegerFunctions2INTEL: return "IntegerFunctions2INTEL"; + case Capability::FunctionPointersINTEL: return "FunctionPointersINTEL"; + case Capability::IndirectReferencesINTEL: return "IndirectReferencesINTEL"; + case Capability::AsmINTEL: return "AsmINTEL"; + case Capability::AtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT"; + case Capability::AtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT"; + case Capability::AtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT"; + case Capability::VectorComputeINTEL: return "VectorComputeINTEL"; + case Capability::VectorAnyINTEL: return "VectorAnyINTEL"; + case Capability::ExpectAssumeKHR: return "ExpectAssumeKHR"; + case Capability::SubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL"; + case Capability::SubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL"; + case Capability::SubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL"; + case Capability::VariableLengthArrayINTEL: return "VariableLengthArrayINTEL"; + case Capability::FunctionFloatControlINTEL: return "FunctionFloatControlINTEL"; + case Capability::FPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL"; + case Capability::FPFastMathModeINTEL: return "FPFastMathModeINTEL"; + case Capability::ArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL"; + case Capability::ArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL"; + case Capability::UnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL"; + case Capability::FPGALoopControlsINTEL: return "FPGALoopControlsINTEL"; + case Capability::KernelAttributesINTEL: return "KernelAttributesINTEL"; + case Capability::FPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL"; + case Capability::FPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL"; + case Capability::FPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL"; + case Capability::LoopFuseINTEL: return "LoopFuseINTEL"; + case Capability::FPGADSPControlINTEL: return "FPGADSPControlINTEL"; + case Capability::MemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL"; + case Capability::FPGAInvocationPipeliningAttributesINTEL: return "FPGAInvocationPipeliningAttributesINTEL"; + case Capability::FPGABufferLocationINTEL: return "FPGABufferLocationINTEL"; + case Capability::ArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL"; + case Capability::USMStorageClassesINTEL: return "USMStorageClassesINTEL"; + case Capability::RuntimeAlignedAttributeINTEL: return "RuntimeAlignedAttributeINTEL"; + case Capability::IOPipesINTEL: return "IOPipesINTEL"; + case Capability::BlockingPipesINTEL: return "BlockingPipesINTEL"; + case Capability::FPGARegINTEL: return "FPGARegINTEL"; + case Capability::DotProductInputAll: return "DotProductInputAll"; + case Capability::DotProductInput4x8Bit: return "DotProductInput4x8Bit"; + case Capability::DotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked"; + case Capability::DotProduct: return "DotProduct"; + case Capability::RayCullMaskKHR: return "RayCullMaskKHR"; + case Capability::CooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case Capability::ReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; + case Capability::BitInstructions: return "BitInstructions"; + case Capability::GroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; + case Capability::FloatControls2: return "FloatControls2"; + case Capability::AtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; + case Capability::AtomicFloat64AddEXT: return "AtomicFloat64AddEXT"; + case Capability::LongCompositesINTEL: return "LongCompositesINTEL"; + case Capability::OptNoneEXT: return "OptNoneEXT"; + case Capability::AtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; + case Capability::DebugInfoModuleINTEL: return "DebugInfoModuleINTEL"; + case Capability::BFloat16ConversionINTEL: return "BFloat16ConversionINTEL"; + case Capability::SplitBarrierINTEL: return "SplitBarrierINTEL"; + case Capability::ArithmeticFenceEXT: return "ArithmeticFenceEXT"; + case Capability::FPGAClusterAttributesV2INTEL: return "FPGAClusterAttributesV2INTEL"; + case Capability::FPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL"; + case Capability::FPMaxErrorINTEL: return "FPMaxErrorINTEL"; + case Capability::FPGALatencyControlINTEL: return "FPGALatencyControlINTEL"; + case Capability::FPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL"; + case Capability::GlobalVariableHostAccessINTEL: return "GlobalVariableHostAccessINTEL"; + case Capability::GlobalVariableFPGADecorationsINTEL: return "GlobalVariableFPGADecorationsINTEL"; + case Capability::SubgroupBufferPrefetchINTEL: return "SubgroupBufferPrefetchINTEL"; + case Capability::Subgroup2DBlockIOINTEL: return "Subgroup2DBlockIOINTEL"; + case Capability::Subgroup2DBlockTransformINTEL: return "Subgroup2DBlockTransformINTEL"; + case Capability::Subgroup2DBlockTransposeINTEL: return "Subgroup2DBlockTransposeINTEL"; + case Capability::SubgroupMatrixMultiplyAccumulateINTEL: return "SubgroupMatrixMultiplyAccumulateINTEL"; + case Capability::GroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR"; + case Capability::MaskedGatherScatterINTEL: return "MaskedGatherScatterINTEL"; + case Capability::CacheControlsINTEL: return "CacheControlsINTEL"; + case Capability::RegisterLimitsINTEL: return "RegisterLimitsINTEL"; + default: return "Unknown"; + } +} + +inline const char* RayQueryIntersectionToString(RayQueryIntersection value) { + switch (value) { + case RayQueryIntersection::RayQueryCandidateIntersectionKHR: return "RayQueryCandidateIntersectionKHR"; + case RayQueryIntersection::RayQueryCommittedIntersectionKHR: return "RayQueryCommittedIntersectionKHR"; + default: return "Unknown"; + } +} + +inline const char* RayQueryCommittedIntersectionTypeToString(RayQueryCommittedIntersectionType value) { + switch (value) { + case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionNoneKHR: return "RayQueryCommittedIntersectionNoneKHR"; + case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionTriangleKHR: return "RayQueryCommittedIntersectionTriangleKHR"; + case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionGeneratedKHR: return "RayQueryCommittedIntersectionGeneratedKHR"; + default: return "Unknown"; + } +} + +inline const char* RayQueryCandidateIntersectionTypeToString(RayQueryCandidateIntersectionType value) { + switch (value) { + case RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionTriangleKHR: return "RayQueryCandidateIntersectionTriangleKHR"; + case RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionAABBKHR: return "RayQueryCandidateIntersectionAABBKHR"; + default: return "Unknown"; + } +} + +inline const char* FPDenormModeToString(FPDenormMode value) { + switch (value) { + case FPDenormMode::Preserve: return "Preserve"; + case FPDenormMode::FlushToZero: return "FlushToZero"; + default: return "Unknown"; + } +} + +inline const char* FPOperationModeToString(FPOperationMode value) { + switch (value) { + case FPOperationMode::IEEE: return "IEEE"; + case FPOperationMode::ALT: return "ALT"; + default: return "Unknown"; + } +} + +inline const char* QuantizationModesToString(QuantizationModes value) { + switch (value) { + case QuantizationModes::TRN: return "TRN"; + case QuantizationModes::TRN_ZERO: return "TRN_ZERO"; + case QuantizationModes::RND: return "RND"; + case QuantizationModes::RND_ZERO: return "RND_ZERO"; + case QuantizationModes::RND_INF: return "RND_INF"; + case QuantizationModes::RND_MIN_INF: return "RND_MIN_INF"; + case QuantizationModes::RND_CONV: return "RND_CONV"; + case QuantizationModes::RND_CONV_ODD: return "RND_CONV_ODD"; + default: return "Unknown"; + } +} + +inline const char* OverflowModesToString(OverflowModes value) { + switch (value) { + case OverflowModes::WRAP: return "WRAP"; + case OverflowModes::SAT: return "SAT"; + case OverflowModes::SAT_ZERO: return "SAT_ZERO"; + case OverflowModes::SAT_SYM: return "SAT_SYM"; + default: return "Unknown"; + } +} + +inline const char* PackedVectorFormatToString(PackedVectorFormat value) { + switch (value) { + case PackedVectorFormat::PackedVectorFormat4x8Bit: return "PackedVectorFormat4x8Bit"; + default: return "Unknown"; + } +} + +inline const char* CooperativeMatrixLayoutToString(CooperativeMatrixLayout value) { + switch (value) { + case CooperativeMatrixLayout::RowMajorKHR: return "RowMajorKHR"; + case CooperativeMatrixLayout::ColumnMajorKHR: return "ColumnMajorKHR"; + case CooperativeMatrixLayout::RowBlockedInterleavedARM: return "RowBlockedInterleavedARM"; + case CooperativeMatrixLayout::ColumnBlockedInterleavedARM: return "ColumnBlockedInterleavedARM"; + default: return "Unknown"; + } +} + +inline const char* CooperativeMatrixUseToString(CooperativeMatrixUse value) { + switch (value) { + case CooperativeMatrixUse::MatrixAKHR: return "MatrixAKHR"; + case CooperativeMatrixUse::MatrixBKHR: return "MatrixBKHR"; + case CooperativeMatrixUse::MatrixAccumulatorKHR: return "MatrixAccumulatorKHR"; + default: return "Unknown"; + } +} + +inline const char* TensorClampModeToString(TensorClampMode value) { + switch (value) { + case TensorClampMode::Undefined: return "Undefined"; + case TensorClampMode::Constant: return "Constant"; + case TensorClampMode::ClampToEdge: return "ClampToEdge"; + case TensorClampMode::Repeat: return "Repeat"; + case TensorClampMode::RepeatMirrored: return "RepeatMirrored"; + default: return "Unknown"; + } +} + +inline const char* InitializationModeQualifierToString(InitializationModeQualifier value) { + switch (value) { + case InitializationModeQualifier::InitOnDeviceReprogramINTEL: return "InitOnDeviceReprogramINTEL"; + case InitializationModeQualifier::InitOnDeviceResetINTEL: return "InitOnDeviceResetINTEL"; + default: return "Unknown"; + } +} + +inline const char* HostAccessQualifierToString(HostAccessQualifier value) { + switch (value) { + case HostAccessQualifier::NoneINTEL: return "NoneINTEL"; + case HostAccessQualifier::ReadINTEL: return "ReadINTEL"; + case HostAccessQualifier::WriteINTEL: return "WriteINTEL"; + case HostAccessQualifier::ReadWriteINTEL: return "ReadWriteINTEL"; + default: return "Unknown"; + } +} + +inline const char* LoadCacheControlToString(LoadCacheControl value) { + switch (value) { + case LoadCacheControl::UncachedINTEL: return "UncachedINTEL"; + case LoadCacheControl::CachedINTEL: return "CachedINTEL"; + case LoadCacheControl::StreamingINTEL: return "StreamingINTEL"; + case LoadCacheControl::InvalidateAfterReadINTEL: return "InvalidateAfterReadINTEL"; + case LoadCacheControl::ConstCachedINTEL: return "ConstCachedINTEL"; + default: return "Unknown"; + } +} + +inline const char* StoreCacheControlToString(StoreCacheControl value) { + switch (value) { + case StoreCacheControl::UncachedINTEL: return "UncachedINTEL"; + case StoreCacheControl::WriteThroughINTEL: return "WriteThroughINTEL"; + case StoreCacheControl::WriteBackINTEL: return "WriteBackINTEL"; + case StoreCacheControl::StreamingINTEL: return "StreamingINTEL"; + default: return "Unknown"; + } +} + +inline const char* NamedMaximumNumberOfRegistersToString(NamedMaximumNumberOfRegisters value) { + switch (value) { + case NamedMaximumNumberOfRegisters::AutoINTEL: return "AutoINTEL"; + default: return "Unknown"; + } +} + +inline const char* FPEncodingToString(FPEncoding value) { + switch (value) { + case FPEncoding::BFloat16KHR: return "BFloat16KHR"; + case FPEncoding::Float8E4M3EXT: return "Float8E4M3EXT"; + case FPEncoding::Float8E5M2EXT: return "Float8E5M2EXT"; + default: return "Unknown"; + } +} + +inline const char* CooperativeVectorMatrixLayoutToString(CooperativeVectorMatrixLayout value) { + switch (value) { + case CooperativeVectorMatrixLayout::RowMajorNV: return "RowMajorNV"; + case CooperativeVectorMatrixLayout::ColumnMajorNV: return "ColumnMajorNV"; + case CooperativeVectorMatrixLayout::InferencingOptimalNV: return "InferencingOptimalNV"; + case CooperativeVectorMatrixLayout::TrainingOptimalNV: return "TrainingOptimalNV"; + default: return "Unknown"; + } +} + +inline const char* ComponentTypeToString(ComponentType value) { + switch (value) { + case ComponentType::Float16NV: return "Float16NV"; + case ComponentType::Float32NV: return "Float32NV"; + case ComponentType::Float64NV: return "Float64NV"; + case ComponentType::SignedInt8NV: return "SignedInt8NV"; + case ComponentType::SignedInt16NV: return "SignedInt16NV"; + case ComponentType::SignedInt32NV: return "SignedInt32NV"; + case ComponentType::SignedInt64NV: return "SignedInt64NV"; + case ComponentType::UnsignedInt8NV: return "UnsignedInt8NV"; + case ComponentType::UnsignedInt16NV: return "UnsignedInt16NV"; + case ComponentType::UnsignedInt32NV: return "UnsignedInt32NV"; + case ComponentType::UnsignedInt64NV: return "UnsignedInt64NV"; + case ComponentType::SignedInt8PackedNV: return "SignedInt8PackedNV"; + case ComponentType::UnsignedInt8PackedNV: return "UnsignedInt8PackedNV"; + case ComponentType::FloatE4M3NV: return "FloatE4M3NV"; + case ComponentType::FloatE5M2NV: return "FloatE5M2NV"; + default: return "Unknown"; + } +} + +inline const char* OpToString(Op value) { + switch (value) { + case Op::OpNop: return "OpNop"; + case Op::OpUndef: return "OpUndef"; + case Op::OpSourceContinued: return "OpSourceContinued"; + case Op::OpSource: return "OpSource"; + case Op::OpSourceExtension: return "OpSourceExtension"; + case Op::OpName: return "OpName"; + case Op::OpMemberName: return "OpMemberName"; + case Op::OpString: return "OpString"; + case Op::OpLine: return "OpLine"; + case Op::OpExtension: return "OpExtension"; + case Op::OpExtInstImport: return "OpExtInstImport"; + case Op::OpExtInst: return "OpExtInst"; + case Op::OpMemoryModel: return "OpMemoryModel"; + case Op::OpEntryPoint: return "OpEntryPoint"; + case Op::OpExecutionMode: return "OpExecutionMode"; + case Op::OpCapability: return "OpCapability"; + case Op::OpTypeVoid: return "OpTypeVoid"; + case Op::OpTypeBool: return "OpTypeBool"; + case Op::OpTypeInt: return "OpTypeInt"; + case Op::OpTypeFloat: return "OpTypeFloat"; + case Op::OpTypeVector: return "OpTypeVector"; + case Op::OpTypeMatrix: return "OpTypeMatrix"; + case Op::OpTypeImage: return "OpTypeImage"; + case Op::OpTypeSampler: return "OpTypeSampler"; + case Op::OpTypeSampledImage: return "OpTypeSampledImage"; + case Op::OpTypeArray: return "OpTypeArray"; + case Op::OpTypeRuntimeArray: return "OpTypeRuntimeArray"; + case Op::OpTypeStruct: return "OpTypeStruct"; + case Op::OpTypeOpaque: return "OpTypeOpaque"; + case Op::OpTypePointer: return "OpTypePointer"; + case Op::OpTypeFunction: return "OpTypeFunction"; + case Op::OpTypeEvent: return "OpTypeEvent"; + case Op::OpTypeDeviceEvent: return "OpTypeDeviceEvent"; + case Op::OpTypeReserveId: return "OpTypeReserveId"; + case Op::OpTypeQueue: return "OpTypeQueue"; + case Op::OpTypePipe: return "OpTypePipe"; + case Op::OpTypeForwardPointer: return "OpTypeForwardPointer"; + case Op::OpConstantTrue: return "OpConstantTrue"; + case Op::OpConstantFalse: return "OpConstantFalse"; + case Op::OpConstant: return "OpConstant"; + case Op::OpConstantComposite: return "OpConstantComposite"; + case Op::OpConstantSampler: return "OpConstantSampler"; + case Op::OpConstantNull: return "OpConstantNull"; + case Op::OpSpecConstantTrue: return "OpSpecConstantTrue"; + case Op::OpSpecConstantFalse: return "OpSpecConstantFalse"; + case Op::OpSpecConstant: return "OpSpecConstant"; + case Op::OpSpecConstantComposite: return "OpSpecConstantComposite"; + case Op::OpSpecConstantOp: return "OpSpecConstantOp"; + case Op::OpFunction: return "OpFunction"; + case Op::OpFunctionParameter: return "OpFunctionParameter"; + case Op::OpFunctionEnd: return "OpFunctionEnd"; + case Op::OpFunctionCall: return "OpFunctionCall"; + case Op::OpVariable: return "OpVariable"; + case Op::OpImageTexelPointer: return "OpImageTexelPointer"; + case Op::OpLoad: return "OpLoad"; + case Op::OpStore: return "OpStore"; + case Op::OpCopyMemory: return "OpCopyMemory"; + case Op::OpCopyMemorySized: return "OpCopyMemorySized"; + case Op::OpAccessChain: return "OpAccessChain"; + case Op::OpInBoundsAccessChain: return "OpInBoundsAccessChain"; + case Op::OpPtrAccessChain: return "OpPtrAccessChain"; + case Op::OpArrayLength: return "OpArrayLength"; + case Op::OpGenericPtrMemSemantics: return "OpGenericPtrMemSemantics"; + case Op::OpInBoundsPtrAccessChain: return "OpInBoundsPtrAccessChain"; + case Op::OpDecorate: return "OpDecorate"; + case Op::OpMemberDecorate: return "OpMemberDecorate"; + case Op::OpDecorationGroup: return "OpDecorationGroup"; + case Op::OpGroupDecorate: return "OpGroupDecorate"; + case Op::OpGroupMemberDecorate: return "OpGroupMemberDecorate"; + case Op::OpVectorExtractDynamic: return "OpVectorExtractDynamic"; + case Op::OpVectorInsertDynamic: return "OpVectorInsertDynamic"; + case Op::OpVectorShuffle: return "OpVectorShuffle"; + case Op::OpCompositeConstruct: return "OpCompositeConstruct"; + case Op::OpCompositeExtract: return "OpCompositeExtract"; + case Op::OpCompositeInsert: return "OpCompositeInsert"; + case Op::OpCopyObject: return "OpCopyObject"; + case Op::OpTranspose: return "OpTranspose"; + case Op::OpSampledImage: return "OpSampledImage"; + case Op::OpImageSampleImplicitLod: return "OpImageSampleImplicitLod"; + case Op::OpImageSampleExplicitLod: return "OpImageSampleExplicitLod"; + case Op::OpImageSampleDrefImplicitLod: return "OpImageSampleDrefImplicitLod"; + case Op::OpImageSampleDrefExplicitLod: return "OpImageSampleDrefExplicitLod"; + case Op::OpImageSampleProjImplicitLod: return "OpImageSampleProjImplicitLod"; + case Op::OpImageSampleProjExplicitLod: return "OpImageSampleProjExplicitLod"; + case Op::OpImageSampleProjDrefImplicitLod: return "OpImageSampleProjDrefImplicitLod"; + case Op::OpImageSampleProjDrefExplicitLod: return "OpImageSampleProjDrefExplicitLod"; + case Op::OpImageFetch: return "OpImageFetch"; + case Op::OpImageGather: return "OpImageGather"; + case Op::OpImageDrefGather: return "OpImageDrefGather"; + case Op::OpImageRead: return "OpImageRead"; + case Op::OpImageWrite: return "OpImageWrite"; + case Op::OpImage: return "OpImage"; + case Op::OpImageQueryFormat: return "OpImageQueryFormat"; + case Op::OpImageQueryOrder: return "OpImageQueryOrder"; + case Op::OpImageQuerySizeLod: return "OpImageQuerySizeLod"; + case Op::OpImageQuerySize: return "OpImageQuerySize"; + case Op::OpImageQueryLod: return "OpImageQueryLod"; + case Op::OpImageQueryLevels: return "OpImageQueryLevels"; + case Op::OpImageQuerySamples: return "OpImageQuerySamples"; + case Op::OpConvertFToU: return "OpConvertFToU"; + case Op::OpConvertFToS: return "OpConvertFToS"; + case Op::OpConvertSToF: return "OpConvertSToF"; + case Op::OpConvertUToF: return "OpConvertUToF"; + case Op::OpUConvert: return "OpUConvert"; + case Op::OpSConvert: return "OpSConvert"; + case Op::OpFConvert: return "OpFConvert"; + case Op::OpQuantizeToF16: return "OpQuantizeToF16"; + case Op::OpConvertPtrToU: return "OpConvertPtrToU"; + case Op::OpSatConvertSToU: return "OpSatConvertSToU"; + case Op::OpSatConvertUToS: return "OpSatConvertUToS"; + case Op::OpConvertUToPtr: return "OpConvertUToPtr"; + case Op::OpPtrCastToGeneric: return "OpPtrCastToGeneric"; + case Op::OpGenericCastToPtr: return "OpGenericCastToPtr"; + case Op::OpGenericCastToPtrExplicit: return "OpGenericCastToPtrExplicit"; + case Op::OpBitcast: return "OpBitcast"; + case Op::OpSNegate: return "OpSNegate"; + case Op::OpFNegate: return "OpFNegate"; + case Op::OpIAdd: return "OpIAdd"; + case Op::OpFAdd: return "OpFAdd"; + case Op::OpISub: return "OpISub"; + case Op::OpFSub: return "OpFSub"; + case Op::OpIMul: return "OpIMul"; + case Op::OpFMul: return "OpFMul"; + case Op::OpUDiv: return "OpUDiv"; + case Op::OpSDiv: return "OpSDiv"; + case Op::OpFDiv: return "OpFDiv"; + case Op::OpUMod: return "OpUMod"; + case Op::OpSRem: return "OpSRem"; + case Op::OpSMod: return "OpSMod"; + case Op::OpFRem: return "OpFRem"; + case Op::OpFMod: return "OpFMod"; + case Op::OpVectorTimesScalar: return "OpVectorTimesScalar"; + case Op::OpMatrixTimesScalar: return "OpMatrixTimesScalar"; + case Op::OpVectorTimesMatrix: return "OpVectorTimesMatrix"; + case Op::OpMatrixTimesVector: return "OpMatrixTimesVector"; + case Op::OpMatrixTimesMatrix: return "OpMatrixTimesMatrix"; + case Op::OpOuterProduct: return "OpOuterProduct"; + case Op::OpDot: return "OpDot"; + case Op::OpIAddCarry: return "OpIAddCarry"; + case Op::OpISubBorrow: return "OpISubBorrow"; + case Op::OpUMulExtended: return "OpUMulExtended"; + case Op::OpSMulExtended: return "OpSMulExtended"; + case Op::OpAny: return "OpAny"; + case Op::OpAll: return "OpAll"; + case Op::OpIsNan: return "OpIsNan"; + case Op::OpIsInf: return "OpIsInf"; + case Op::OpIsFinite: return "OpIsFinite"; + case Op::OpIsNormal: return "OpIsNormal"; + case Op::OpSignBitSet: return "OpSignBitSet"; + case Op::OpLessOrGreater: return "OpLessOrGreater"; + case Op::OpOrdered: return "OpOrdered"; + case Op::OpUnordered: return "OpUnordered"; + case Op::OpLogicalEqual: return "OpLogicalEqual"; + case Op::OpLogicalNotEqual: return "OpLogicalNotEqual"; + case Op::OpLogicalOr: return "OpLogicalOr"; + case Op::OpLogicalAnd: return "OpLogicalAnd"; + case Op::OpLogicalNot: return "OpLogicalNot"; + case Op::OpSelect: return "OpSelect"; + case Op::OpIEqual: return "OpIEqual"; + case Op::OpINotEqual: return "OpINotEqual"; + case Op::OpUGreaterThan: return "OpUGreaterThan"; + case Op::OpSGreaterThan: return "OpSGreaterThan"; + case Op::OpUGreaterThanEqual: return "OpUGreaterThanEqual"; + case Op::OpSGreaterThanEqual: return "OpSGreaterThanEqual"; + case Op::OpULessThan: return "OpULessThan"; + case Op::OpSLessThan: return "OpSLessThan"; + case Op::OpULessThanEqual: return "OpULessThanEqual"; + case Op::OpSLessThanEqual: return "OpSLessThanEqual"; + case Op::OpFOrdEqual: return "OpFOrdEqual"; + case Op::OpFUnordEqual: return "OpFUnordEqual"; + case Op::OpFOrdNotEqual: return "OpFOrdNotEqual"; + case Op::OpFUnordNotEqual: return "OpFUnordNotEqual"; + case Op::OpFOrdLessThan: return "OpFOrdLessThan"; + case Op::OpFUnordLessThan: return "OpFUnordLessThan"; + case Op::OpFOrdGreaterThan: return "OpFOrdGreaterThan"; + case Op::OpFUnordGreaterThan: return "OpFUnordGreaterThan"; + case Op::OpFOrdLessThanEqual: return "OpFOrdLessThanEqual"; + case Op::OpFUnordLessThanEqual: return "OpFUnordLessThanEqual"; + case Op::OpFOrdGreaterThanEqual: return "OpFOrdGreaterThanEqual"; + case Op::OpFUnordGreaterThanEqual: return "OpFUnordGreaterThanEqual"; + case Op::OpShiftRightLogical: return "OpShiftRightLogical"; + case Op::OpShiftRightArithmetic: return "OpShiftRightArithmetic"; + case Op::OpShiftLeftLogical: return "OpShiftLeftLogical"; + case Op::OpBitwiseOr: return "OpBitwiseOr"; + case Op::OpBitwiseXor: return "OpBitwiseXor"; + case Op::OpBitwiseAnd: return "OpBitwiseAnd"; + case Op::OpNot: return "OpNot"; + case Op::OpBitFieldInsert: return "OpBitFieldInsert"; + case Op::OpBitFieldSExtract: return "OpBitFieldSExtract"; + case Op::OpBitFieldUExtract: return "OpBitFieldUExtract"; + case Op::OpBitReverse: return "OpBitReverse"; + case Op::OpBitCount: return "OpBitCount"; + case Op::OpDPdx: return "OpDPdx"; + case Op::OpDPdy: return "OpDPdy"; + case Op::OpFwidth: return "OpFwidth"; + case Op::OpDPdxFine: return "OpDPdxFine"; + case Op::OpDPdyFine: return "OpDPdyFine"; + case Op::OpFwidthFine: return "OpFwidthFine"; + case Op::OpDPdxCoarse: return "OpDPdxCoarse"; + case Op::OpDPdyCoarse: return "OpDPdyCoarse"; + case Op::OpFwidthCoarse: return "OpFwidthCoarse"; + case Op::OpEmitVertex: return "OpEmitVertex"; + case Op::OpEndPrimitive: return "OpEndPrimitive"; + case Op::OpEmitStreamVertex: return "OpEmitStreamVertex"; + case Op::OpEndStreamPrimitive: return "OpEndStreamPrimitive"; + case Op::OpControlBarrier: return "OpControlBarrier"; + case Op::OpMemoryBarrier: return "OpMemoryBarrier"; + case Op::OpAtomicLoad: return "OpAtomicLoad"; + case Op::OpAtomicStore: return "OpAtomicStore"; + case Op::OpAtomicExchange: return "OpAtomicExchange"; + case Op::OpAtomicCompareExchange: return "OpAtomicCompareExchange"; + case Op::OpAtomicCompareExchangeWeak: return "OpAtomicCompareExchangeWeak"; + case Op::OpAtomicIIncrement: return "OpAtomicIIncrement"; + case Op::OpAtomicIDecrement: return "OpAtomicIDecrement"; + case Op::OpAtomicIAdd: return "OpAtomicIAdd"; + case Op::OpAtomicISub: return "OpAtomicISub"; + case Op::OpAtomicSMin: return "OpAtomicSMin"; + case Op::OpAtomicUMin: return "OpAtomicUMin"; + case Op::OpAtomicSMax: return "OpAtomicSMax"; + case Op::OpAtomicUMax: return "OpAtomicUMax"; + case Op::OpAtomicAnd: return "OpAtomicAnd"; + case Op::OpAtomicOr: return "OpAtomicOr"; + case Op::OpAtomicXor: return "OpAtomicXor"; + case Op::OpPhi: return "OpPhi"; + case Op::OpLoopMerge: return "OpLoopMerge"; + case Op::OpSelectionMerge: return "OpSelectionMerge"; + case Op::OpLabel: return "OpLabel"; + case Op::OpBranch: return "OpBranch"; + case Op::OpBranchConditional: return "OpBranchConditional"; + case Op::OpSwitch: return "OpSwitch"; + case Op::OpKill: return "OpKill"; + case Op::OpReturn: return "OpReturn"; + case Op::OpReturnValue: return "OpReturnValue"; + case Op::OpUnreachable: return "OpUnreachable"; + case Op::OpLifetimeStart: return "OpLifetimeStart"; + case Op::OpLifetimeStop: return "OpLifetimeStop"; + case Op::OpGroupAsyncCopy: return "OpGroupAsyncCopy"; + case Op::OpGroupWaitEvents: return "OpGroupWaitEvents"; + case Op::OpGroupAll: return "OpGroupAll"; + case Op::OpGroupAny: return "OpGroupAny"; + case Op::OpGroupBroadcast: return "OpGroupBroadcast"; + case Op::OpGroupIAdd: return "OpGroupIAdd"; + case Op::OpGroupFAdd: return "OpGroupFAdd"; + case Op::OpGroupFMin: return "OpGroupFMin"; + case Op::OpGroupUMin: return "OpGroupUMin"; + case Op::OpGroupSMin: return "OpGroupSMin"; + case Op::OpGroupFMax: return "OpGroupFMax"; + case Op::OpGroupUMax: return "OpGroupUMax"; + case Op::OpGroupSMax: return "OpGroupSMax"; + case Op::OpReadPipe: return "OpReadPipe"; + case Op::OpWritePipe: return "OpWritePipe"; + case Op::OpReservedReadPipe: return "OpReservedReadPipe"; + case Op::OpReservedWritePipe: return "OpReservedWritePipe"; + case Op::OpReserveReadPipePackets: return "OpReserveReadPipePackets"; + case Op::OpReserveWritePipePackets: return "OpReserveWritePipePackets"; + case Op::OpCommitReadPipe: return "OpCommitReadPipe"; + case Op::OpCommitWritePipe: return "OpCommitWritePipe"; + case Op::OpIsValidReserveId: return "OpIsValidReserveId"; + case Op::OpGetNumPipePackets: return "OpGetNumPipePackets"; + case Op::OpGetMaxPipePackets: return "OpGetMaxPipePackets"; + case Op::OpGroupReserveReadPipePackets: return "OpGroupReserveReadPipePackets"; + case Op::OpGroupReserveWritePipePackets: return "OpGroupReserveWritePipePackets"; + case Op::OpGroupCommitReadPipe: return "OpGroupCommitReadPipe"; + case Op::OpGroupCommitWritePipe: return "OpGroupCommitWritePipe"; + case Op::OpEnqueueMarker: return "OpEnqueueMarker"; + case Op::OpEnqueueKernel: return "OpEnqueueKernel"; + case Op::OpGetKernelNDrangeSubGroupCount: return "OpGetKernelNDrangeSubGroupCount"; + case Op::OpGetKernelNDrangeMaxSubGroupSize: return "OpGetKernelNDrangeMaxSubGroupSize"; + case Op::OpGetKernelWorkGroupSize: return "OpGetKernelWorkGroupSize"; + case Op::OpGetKernelPreferredWorkGroupSizeMultiple: return "OpGetKernelPreferredWorkGroupSizeMultiple"; + case Op::OpRetainEvent: return "OpRetainEvent"; + case Op::OpReleaseEvent: return "OpReleaseEvent"; + case Op::OpCreateUserEvent: return "OpCreateUserEvent"; + case Op::OpIsValidEvent: return "OpIsValidEvent"; + case Op::OpSetUserEventStatus: return "OpSetUserEventStatus"; + case Op::OpCaptureEventProfilingInfo: return "OpCaptureEventProfilingInfo"; + case Op::OpGetDefaultQueue: return "OpGetDefaultQueue"; + case Op::OpBuildNDRange: return "OpBuildNDRange"; + case Op::OpImageSparseSampleImplicitLod: return "OpImageSparseSampleImplicitLod"; + case Op::OpImageSparseSampleExplicitLod: return "OpImageSparseSampleExplicitLod"; + case Op::OpImageSparseSampleDrefImplicitLod: return "OpImageSparseSampleDrefImplicitLod"; + case Op::OpImageSparseSampleDrefExplicitLod: return "OpImageSparseSampleDrefExplicitLod"; + case Op::OpImageSparseSampleProjImplicitLod: return "OpImageSparseSampleProjImplicitLod"; + case Op::OpImageSparseSampleProjExplicitLod: return "OpImageSparseSampleProjExplicitLod"; + case Op::OpImageSparseSampleProjDrefImplicitLod: return "OpImageSparseSampleProjDrefImplicitLod"; + case Op::OpImageSparseSampleProjDrefExplicitLod: return "OpImageSparseSampleProjDrefExplicitLod"; + case Op::OpImageSparseFetch: return "OpImageSparseFetch"; + case Op::OpImageSparseGather: return "OpImageSparseGather"; + case Op::OpImageSparseDrefGather: return "OpImageSparseDrefGather"; + case Op::OpImageSparseTexelsResident: return "OpImageSparseTexelsResident"; + case Op::OpNoLine: return "OpNoLine"; + case Op::OpAtomicFlagTestAndSet: return "OpAtomicFlagTestAndSet"; + case Op::OpAtomicFlagClear: return "OpAtomicFlagClear"; + case Op::OpImageSparseRead: return "OpImageSparseRead"; + case Op::OpSizeOf: return "OpSizeOf"; + case Op::OpTypePipeStorage: return "OpTypePipeStorage"; + case Op::OpConstantPipeStorage: return "OpConstantPipeStorage"; + case Op::OpCreatePipeFromPipeStorage: return "OpCreatePipeFromPipeStorage"; + case Op::OpGetKernelLocalSizeForSubgroupCount: return "OpGetKernelLocalSizeForSubgroupCount"; + case Op::OpGetKernelMaxNumSubgroups: return "OpGetKernelMaxNumSubgroups"; + case Op::OpTypeNamedBarrier: return "OpTypeNamedBarrier"; + case Op::OpNamedBarrierInitialize: return "OpNamedBarrierInitialize"; + case Op::OpMemoryNamedBarrier: return "OpMemoryNamedBarrier"; + case Op::OpModuleProcessed: return "OpModuleProcessed"; + case Op::OpExecutionModeId: return "OpExecutionModeId"; + case Op::OpDecorateId: return "OpDecorateId"; + case Op::OpGroupNonUniformElect: return "OpGroupNonUniformElect"; + case Op::OpGroupNonUniformAll: return "OpGroupNonUniformAll"; + case Op::OpGroupNonUniformAny: return "OpGroupNonUniformAny"; + case Op::OpGroupNonUniformAllEqual: return "OpGroupNonUniformAllEqual"; + case Op::OpGroupNonUniformBroadcast: return "OpGroupNonUniformBroadcast"; + case Op::OpGroupNonUniformBroadcastFirst: return "OpGroupNonUniformBroadcastFirst"; + case Op::OpGroupNonUniformBallot: return "OpGroupNonUniformBallot"; + case Op::OpGroupNonUniformInverseBallot: return "OpGroupNonUniformInverseBallot"; + case Op::OpGroupNonUniformBallotBitExtract: return "OpGroupNonUniformBallotBitExtract"; + case Op::OpGroupNonUniformBallotBitCount: return "OpGroupNonUniformBallotBitCount"; + case Op::OpGroupNonUniformBallotFindLSB: return "OpGroupNonUniformBallotFindLSB"; + case Op::OpGroupNonUniformBallotFindMSB: return "OpGroupNonUniformBallotFindMSB"; + case Op::OpGroupNonUniformShuffle: return "OpGroupNonUniformShuffle"; + case Op::OpGroupNonUniformShuffleXor: return "OpGroupNonUniformShuffleXor"; + case Op::OpGroupNonUniformShuffleUp: return "OpGroupNonUniformShuffleUp"; + case Op::OpGroupNonUniformShuffleDown: return "OpGroupNonUniformShuffleDown"; + case Op::OpGroupNonUniformIAdd: return "OpGroupNonUniformIAdd"; + case Op::OpGroupNonUniformFAdd: return "OpGroupNonUniformFAdd"; + case Op::OpGroupNonUniformIMul: return "OpGroupNonUniformIMul"; + case Op::OpGroupNonUniformFMul: return "OpGroupNonUniformFMul"; + case Op::OpGroupNonUniformSMin: return "OpGroupNonUniformSMin"; + case Op::OpGroupNonUniformUMin: return "OpGroupNonUniformUMin"; + case Op::OpGroupNonUniformFMin: return "OpGroupNonUniformFMin"; + case Op::OpGroupNonUniformSMax: return "OpGroupNonUniformSMax"; + case Op::OpGroupNonUniformUMax: return "OpGroupNonUniformUMax"; + case Op::OpGroupNonUniformFMax: return "OpGroupNonUniformFMax"; + case Op::OpGroupNonUniformBitwiseAnd: return "OpGroupNonUniformBitwiseAnd"; + case Op::OpGroupNonUniformBitwiseOr: return "OpGroupNonUniformBitwiseOr"; + case Op::OpGroupNonUniformBitwiseXor: return "OpGroupNonUniformBitwiseXor"; + case Op::OpGroupNonUniformLogicalAnd: return "OpGroupNonUniformLogicalAnd"; + case Op::OpGroupNonUniformLogicalOr: return "OpGroupNonUniformLogicalOr"; + case Op::OpGroupNonUniformLogicalXor: return "OpGroupNonUniformLogicalXor"; + case Op::OpGroupNonUniformQuadBroadcast: return "OpGroupNonUniformQuadBroadcast"; + case Op::OpGroupNonUniformQuadSwap: return "OpGroupNonUniformQuadSwap"; + case Op::OpCopyLogical: return "OpCopyLogical"; + case Op::OpPtrEqual: return "OpPtrEqual"; + case Op::OpPtrNotEqual: return "OpPtrNotEqual"; + case Op::OpPtrDiff: return "OpPtrDiff"; + case Op::OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; + case Op::OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; + case Op::OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + case Op::OpTypeTensorARM: return "OpTypeTensorARM"; + case Op::OpTensorReadARM: return "OpTensorReadARM"; + case Op::OpTensorWriteARM: return "OpTensorWriteARM"; + case Op::OpTensorQuerySizeARM: return "OpTensorQuerySizeARM"; + case Op::OpTerminateInvocation: return "OpTerminateInvocation"; + case Op::OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR"; + case Op::OpUntypedVariableKHR: return "OpUntypedVariableKHR"; + case Op::OpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR"; + case Op::OpUntypedInBoundsAccessChainKHR: return "OpUntypedInBoundsAccessChainKHR"; + case Op::OpSubgroupBallotKHR: return "OpSubgroupBallotKHR"; + case Op::OpSubgroupFirstInvocationKHR: return "OpSubgroupFirstInvocationKHR"; + case Op::OpUntypedPtrAccessChainKHR: return "OpUntypedPtrAccessChainKHR"; + case Op::OpUntypedInBoundsPtrAccessChainKHR: return "OpUntypedInBoundsPtrAccessChainKHR"; + case Op::OpUntypedArrayLengthKHR: return "OpUntypedArrayLengthKHR"; + case Op::OpUntypedPrefetchKHR: return "OpUntypedPrefetchKHR"; + case Op::OpSubgroupAllKHR: return "OpSubgroupAllKHR"; + case Op::OpSubgroupAnyKHR: return "OpSubgroupAnyKHR"; + case Op::OpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR"; + case Op::OpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR"; + case Op::OpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR"; + case Op::OpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR"; + case Op::OpTraceRayKHR: return "OpTraceRayKHR"; + case Op::OpExecuteCallableKHR: return "OpExecuteCallableKHR"; + case Op::OpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR"; + case Op::OpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR"; + case Op::OpTerminateRayKHR: return "OpTerminateRayKHR"; + case Op::OpSDot: return "OpSDot"; + case Op::OpUDot: return "OpUDot"; + case Op::OpSUDot: return "OpSUDot"; + case Op::OpSDotAccSat: return "OpSDotAccSat"; + case Op::OpUDotAccSat: return "OpUDotAccSat"; + case Op::OpSUDotAccSat: return "OpSUDotAccSat"; + case Op::OpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR"; + case Op::OpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR"; + case Op::OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; + case Op::OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; + case Op::OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case Op::OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case Op::OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case Op::OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; + case Op::OpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; + case Op::OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; + case Op::OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; + case Op::OpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR"; + case Op::OpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR"; + case Op::OpRayQueryProceedKHR: return "OpRayQueryProceedKHR"; + case Op::OpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR"; + case Op::OpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM"; + case Op::OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; + case Op::OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; + case Op::OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; + case Op::OpBitCastArrayQCOM: return "OpBitCastArrayQCOM"; + case Op::OpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM"; + case Op::OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM"; + case Op::OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; + case Op::OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + case Op::OpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM"; + case Op::OpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM"; + case Op::OpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM"; + case Op::OpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD"; + case Op::OpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD"; + case Op::OpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD"; + case Op::OpGroupUMinNonUniformAMD: return "OpGroupUMinNonUniformAMD"; + case Op::OpGroupSMinNonUniformAMD: return "OpGroupSMinNonUniformAMD"; + case Op::OpGroupFMaxNonUniformAMD: return "OpGroupFMaxNonUniformAMD"; + case Op::OpGroupUMaxNonUniformAMD: return "OpGroupUMaxNonUniformAMD"; + case Op::OpGroupSMaxNonUniformAMD: return "OpGroupSMaxNonUniformAMD"; + case Op::OpFragmentMaskFetchAMD: return "OpFragmentMaskFetchAMD"; + case Op::OpFragmentFetchAMD: return "OpFragmentFetchAMD"; + case Op::OpReadClockKHR: return "OpReadClockKHR"; + case Op::OpAllocateNodePayloadsAMDX: return "OpAllocateNodePayloadsAMDX"; + case Op::OpEnqueueNodePayloadsAMDX: return "OpEnqueueNodePayloadsAMDX"; + case Op::OpTypeNodePayloadArrayAMDX: return "OpTypeNodePayloadArrayAMDX"; + case Op::OpFinishWritingNodePayloadAMDX: return "OpFinishWritingNodePayloadAMDX"; + case Op::OpNodePayloadArrayLengthAMDX: return "OpNodePayloadArrayLengthAMDX"; + case Op::OpIsNodePayloadValidAMDX: return "OpIsNodePayloadValidAMDX"; + case Op::OpConstantStringAMDX: return "OpConstantStringAMDX"; + case Op::OpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX"; + case Op::OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; + case Op::OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; + case Op::OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV"; + case Op::OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV"; + case Op::OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV"; + case Op::OpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV"; + case Op::OpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV"; + case Op::OpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV"; + case Op::OpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV"; + case Op::OpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV"; + case Op::OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case Op::OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; + case Op::OpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV"; + case Op::OpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV"; + case Op::OpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV"; + case Op::OpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV"; + case Op::OpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV"; + case Op::OpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV"; + case Op::OpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV"; + case Op::OpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV"; + case Op::OpHitObjectGetHitKindNV: return "OpHitObjectGetHitKindNV"; + case Op::OpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV"; + case Op::OpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV"; + case Op::OpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV"; + case Op::OpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV"; + case Op::OpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV"; + case Op::OpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV"; + case Op::OpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV"; + case Op::OpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV"; + case Op::OpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV"; + case Op::OpHitObjectIsHitNV: return "OpHitObjectIsHitNV"; + case Op::OpHitObjectIsMissNV: return "OpHitObjectIsMissNV"; + case Op::OpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV"; + case Op::OpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV"; + case Op::OpTypeHitObjectNV: return "OpTypeHitObjectNV"; + case Op::OpImageSampleFootprintNV: return "OpImageSampleFootprintNV"; + case Op::OpTypeCooperativeVectorNV: return "OpTypeCooperativeVectorNV"; + case Op::OpCooperativeVectorMatrixMulNV: return "OpCooperativeVectorMatrixMulNV"; + case Op::OpCooperativeVectorOuterProductAccumulateNV: return "OpCooperativeVectorOuterProductAccumulateNV"; + case Op::OpCooperativeVectorReduceSumAccumulateNV: return "OpCooperativeVectorReduceSumAccumulateNV"; + case Op::OpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV"; + case Op::OpCooperativeMatrixConvertNV: return "OpCooperativeMatrixConvertNV"; + case Op::OpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT"; + case Op::OpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT"; + case Op::OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; + case Op::OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV"; + case Op::OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV"; + case Op::OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; + case Op::OpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV"; + case Op::OpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV"; + case Op::OpHitObjectRecordFromQueryEXT: return "OpHitObjectRecordFromQueryEXT"; + case Op::OpHitObjectRecordMissEXT: return "OpHitObjectRecordMissEXT"; + case Op::OpHitObjectRecordMissMotionEXT: return "OpHitObjectRecordMissMotionEXT"; + case Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: return "OpHitObjectGetIntersectionTriangleVertexPositionsEXT"; + case Op::OpHitObjectGetRayFlagsEXT: return "OpHitObjectGetRayFlagsEXT"; + case Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: return "OpHitObjectSetShaderBindingTableRecordIndexEXT"; + case Op::OpHitObjectReorderExecuteShaderEXT: return "OpHitObjectReorderExecuteShaderEXT"; + case Op::OpHitObjectTraceReorderExecuteEXT: return "OpHitObjectTraceReorderExecuteEXT"; + case Op::OpHitObjectTraceMotionReorderExecuteEXT: return "OpHitObjectTraceMotionReorderExecuteEXT"; + case Op::OpTypeHitObjectEXT: return "OpTypeHitObjectEXT"; + case Op::OpReorderThreadWithHintEXT: return "OpReorderThreadWithHintEXT"; + case Op::OpReorderThreadWithHitObjectEXT: return "OpReorderThreadWithHitObjectEXT"; + case Op::OpHitObjectTraceRayEXT: return "OpHitObjectTraceRayEXT"; + case Op::OpHitObjectTraceRayMotionEXT: return "OpHitObjectTraceRayMotionEXT"; + case Op::OpHitObjectRecordEmptyEXT: return "OpHitObjectRecordEmptyEXT"; + case Op::OpHitObjectExecuteShaderEXT: return "OpHitObjectExecuteShaderEXT"; + case Op::OpHitObjectGetCurrentTimeEXT: return "OpHitObjectGetCurrentTimeEXT"; + case Op::OpHitObjectGetAttributesEXT: return "OpHitObjectGetAttributesEXT"; + case Op::OpHitObjectGetHitKindEXT: return "OpHitObjectGetHitKindEXT"; + case Op::OpHitObjectGetPrimitiveIndexEXT: return "OpHitObjectGetPrimitiveIndexEXT"; + case Op::OpHitObjectGetGeometryIndexEXT: return "OpHitObjectGetGeometryIndexEXT"; + case Op::OpHitObjectGetInstanceIdEXT: return "OpHitObjectGetInstanceIdEXT"; + case Op::OpHitObjectGetInstanceCustomIndexEXT: return "OpHitObjectGetInstanceCustomIndexEXT"; + case Op::OpHitObjectGetObjectRayOriginEXT: return "OpHitObjectGetObjectRayOriginEXT"; + case Op::OpHitObjectGetObjectRayDirectionEXT: return "OpHitObjectGetObjectRayDirectionEXT"; + case Op::OpHitObjectGetWorldRayDirectionEXT: return "OpHitObjectGetWorldRayDirectionEXT"; + case Op::OpHitObjectGetWorldRayOriginEXT: return "OpHitObjectGetWorldRayOriginEXT"; + case Op::OpHitObjectGetObjectToWorldEXT: return "OpHitObjectGetObjectToWorldEXT"; + case Op::OpHitObjectGetWorldToObjectEXT: return "OpHitObjectGetWorldToObjectEXT"; + case Op::OpHitObjectGetRayTMaxEXT: return "OpHitObjectGetRayTMaxEXT"; + case Op::OpReportIntersectionKHR: return "OpReportIntersectionKHR"; + case Op::OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; + case Op::OpTerminateRayNV: return "OpTerminateRayNV"; + case Op::OpTraceNV: return "OpTraceNV"; + case Op::OpTraceMotionNV: return "OpTraceMotionNV"; + case Op::OpTraceRayMotionNV: return "OpTraceRayMotionNV"; + case Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR"; + case Op::OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR"; + case Op::OpExecuteCallableNV: return "OpExecuteCallableNV"; + case Op::OpRayQueryGetClusterIdNV: return "OpRayQueryGetClusterIdNV"; + case Op::OpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV"; + case Op::OpHitObjectGetRayTMinEXT: return "OpHitObjectGetRayTMinEXT"; + case Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: return "OpHitObjectGetShaderBindingTableRecordIndexEXT"; + case Op::OpHitObjectGetShaderRecordBufferHandleEXT: return "OpHitObjectGetShaderRecordBufferHandleEXT"; + case Op::OpHitObjectIsEmptyEXT: return "OpHitObjectIsEmptyEXT"; + case Op::OpHitObjectIsHitEXT: return "OpHitObjectIsHitEXT"; + case Op::OpHitObjectIsMissEXT: return "OpHitObjectIsMissEXT"; + case Op::OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; + case Op::OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; + case Op::OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV"; + case Op::OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV"; + case Op::OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV"; + case Op::OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT"; + case Op::OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT"; + case Op::OpCooperativeMatrixReduceNV: return "OpCooperativeMatrixReduceNV"; + case Op::OpCooperativeMatrixLoadTensorNV: return "OpCooperativeMatrixLoadTensorNV"; + case Op::OpCooperativeMatrixStoreTensorNV: return "OpCooperativeMatrixStoreTensorNV"; + case Op::OpCooperativeMatrixPerElementOpNV: return "OpCooperativeMatrixPerElementOpNV"; + case Op::OpTypeTensorLayoutNV: return "OpTypeTensorLayoutNV"; + case Op::OpTypeTensorViewNV: return "OpTypeTensorViewNV"; + case Op::OpCreateTensorLayoutNV: return "OpCreateTensorLayoutNV"; + case Op::OpTensorLayoutSetDimensionNV: return "OpTensorLayoutSetDimensionNV"; + case Op::OpTensorLayoutSetStrideNV: return "OpTensorLayoutSetStrideNV"; + case Op::OpTensorLayoutSliceNV: return "OpTensorLayoutSliceNV"; + case Op::OpTensorLayoutSetClampValueNV: return "OpTensorLayoutSetClampValueNV"; + case Op::OpCreateTensorViewNV: return "OpCreateTensorViewNV"; + case Op::OpTensorViewSetDimensionNV: return "OpTensorViewSetDimensionNV"; + case Op::OpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV"; + case Op::OpDemoteToHelperInvocation: return "OpDemoteToHelperInvocation"; + case Op::OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT"; + case Op::OpTensorViewSetClipNV: return "OpTensorViewSetClipNV"; + case Op::OpTensorLayoutSetBlockSizeNV: return "OpTensorLayoutSetBlockSizeNV"; + case Op::OpCooperativeMatrixTransposeNV: return "OpCooperativeMatrixTransposeNV"; + case Op::OpConvertUToImageNV: return "OpConvertUToImageNV"; + case Op::OpConvertUToSamplerNV: return "OpConvertUToSamplerNV"; + case Op::OpConvertImageToUNV: return "OpConvertImageToUNV"; + case Op::OpConvertSamplerToUNV: return "OpConvertSamplerToUNV"; + case Op::OpConvertUToSampledImageNV: return "OpConvertUToSampledImageNV"; + case Op::OpConvertSampledImageToUNV: return "OpConvertSampledImageToUNV"; + case Op::OpSamplerImageAddressingModeNV: return "OpSamplerImageAddressingModeNV"; + case Op::OpRawAccessChainNV: return "OpRawAccessChainNV"; + case Op::OpRayQueryGetIntersectionSpherePositionNV: return "OpRayQueryGetIntersectionSpherePositionNV"; + case Op::OpRayQueryGetIntersectionSphereRadiusNV: return "OpRayQueryGetIntersectionSphereRadiusNV"; + case Op::OpRayQueryGetIntersectionLSSPositionsNV: return "OpRayQueryGetIntersectionLSSPositionsNV"; + case Op::OpRayQueryGetIntersectionLSSRadiiNV: return "OpRayQueryGetIntersectionLSSRadiiNV"; + case Op::OpRayQueryGetIntersectionLSSHitValueNV: return "OpRayQueryGetIntersectionLSSHitValueNV"; + case Op::OpHitObjectGetSpherePositionNV: return "OpHitObjectGetSpherePositionNV"; + case Op::OpHitObjectGetSphereRadiusNV: return "OpHitObjectGetSphereRadiusNV"; + case Op::OpHitObjectGetLSSPositionsNV: return "OpHitObjectGetLSSPositionsNV"; + case Op::OpHitObjectGetLSSRadiiNV: return "OpHitObjectGetLSSRadiiNV"; + case Op::OpHitObjectIsSphereHitNV: return "OpHitObjectIsSphereHitNV"; + case Op::OpHitObjectIsLSSHitNV: return "OpHitObjectIsLSSHitNV"; + case Op::OpRayQueryIsSphereHitNV: return "OpRayQueryIsSphereHitNV"; + case Op::OpRayQueryIsLSSHitNV: return "OpRayQueryIsLSSHitNV"; + case Op::OpSubgroupShuffleINTEL: return "OpSubgroupShuffleINTEL"; + case Op::OpSubgroupShuffleDownINTEL: return "OpSubgroupShuffleDownINTEL"; + case Op::OpSubgroupShuffleUpINTEL: return "OpSubgroupShuffleUpINTEL"; + case Op::OpSubgroupShuffleXorINTEL: return "OpSubgroupShuffleXorINTEL"; + case Op::OpSubgroupBlockReadINTEL: return "OpSubgroupBlockReadINTEL"; + case Op::OpSubgroupBlockWriteINTEL: return "OpSubgroupBlockWriteINTEL"; + case Op::OpSubgroupImageBlockReadINTEL: return "OpSubgroupImageBlockReadINTEL"; + case Op::OpSubgroupImageBlockWriteINTEL: return "OpSubgroupImageBlockWriteINTEL"; + case Op::OpSubgroupImageMediaBlockReadINTEL: return "OpSubgroupImageMediaBlockReadINTEL"; + case Op::OpSubgroupImageMediaBlockWriteINTEL: return "OpSubgroupImageMediaBlockWriteINTEL"; + case Op::OpUCountLeadingZerosINTEL: return "OpUCountLeadingZerosINTEL"; + case Op::OpUCountTrailingZerosINTEL: return "OpUCountTrailingZerosINTEL"; + case Op::OpAbsISubINTEL: return "OpAbsISubINTEL"; + case Op::OpAbsUSubINTEL: return "OpAbsUSubINTEL"; + case Op::OpIAddSatINTEL: return "OpIAddSatINTEL"; + case Op::OpUAddSatINTEL: return "OpUAddSatINTEL"; + case Op::OpIAverageINTEL: return "OpIAverageINTEL"; + case Op::OpUAverageINTEL: return "OpUAverageINTEL"; + case Op::OpIAverageRoundedINTEL: return "OpIAverageRoundedINTEL"; + case Op::OpUAverageRoundedINTEL: return "OpUAverageRoundedINTEL"; + case Op::OpISubSatINTEL: return "OpISubSatINTEL"; + case Op::OpUSubSatINTEL: return "OpUSubSatINTEL"; + case Op::OpIMul32x16INTEL: return "OpIMul32x16INTEL"; + case Op::OpUMul32x16INTEL: return "OpUMul32x16INTEL"; + case Op::OpConstantFunctionPointerINTEL: return "OpConstantFunctionPointerINTEL"; + case Op::OpFunctionPointerCallINTEL: return "OpFunctionPointerCallINTEL"; + case Op::OpAsmTargetINTEL: return "OpAsmTargetINTEL"; + case Op::OpAsmINTEL: return "OpAsmINTEL"; + case Op::OpAsmCallINTEL: return "OpAsmCallINTEL"; + case Op::OpAtomicFMinEXT: return "OpAtomicFMinEXT"; + case Op::OpAtomicFMaxEXT: return "OpAtomicFMaxEXT"; + case Op::OpAssumeTrueKHR: return "OpAssumeTrueKHR"; + case Op::OpExpectKHR: return "OpExpectKHR"; + case Op::OpDecorateString: return "OpDecorateString"; + case Op::OpMemberDecorateString: return "OpMemberDecorateString"; + case Op::OpVmeImageINTEL: return "OpVmeImageINTEL"; + case Op::OpTypeVmeImageINTEL: return "OpTypeVmeImageINTEL"; + case Op::OpTypeAvcImePayloadINTEL: return "OpTypeAvcImePayloadINTEL"; + case Op::OpTypeAvcRefPayloadINTEL: return "OpTypeAvcRefPayloadINTEL"; + case Op::OpTypeAvcSicPayloadINTEL: return "OpTypeAvcSicPayloadINTEL"; + case Op::OpTypeAvcMcePayloadINTEL: return "OpTypeAvcMcePayloadINTEL"; + case Op::OpTypeAvcMceResultINTEL: return "OpTypeAvcMceResultINTEL"; + case Op::OpTypeAvcImeResultINTEL: return "OpTypeAvcImeResultINTEL"; + case Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL: return "OpTypeAvcImeResultSingleReferenceStreamoutINTEL"; + case Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL: return "OpTypeAvcImeResultDualReferenceStreamoutINTEL"; + case Op::OpTypeAvcImeSingleReferenceStreaminINTEL: return "OpTypeAvcImeSingleReferenceStreaminINTEL"; + case Op::OpTypeAvcImeDualReferenceStreaminINTEL: return "OpTypeAvcImeDualReferenceStreaminINTEL"; + case Op::OpTypeAvcRefResultINTEL: return "OpTypeAvcRefResultINTEL"; + case Op::OpTypeAvcSicResultINTEL: return "OpTypeAvcSicResultINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL"; + case Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL"; + case Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL: return "OpSubgroupAvcMceSetInterShapePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL"; + case Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: return "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL"; + case Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL"; + case Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL"; + case Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL"; + case Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: return "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL"; + case Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL"; + case Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL"; + case Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL: return "OpSubgroupAvcMceSetAcOnlyHaarINTEL"; + case Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL"; + case Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL"; + case Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL"; + case Op::OpSubgroupAvcMceConvertToImePayloadINTEL: return "OpSubgroupAvcMceConvertToImePayloadINTEL"; + case Op::OpSubgroupAvcMceConvertToImeResultINTEL: return "OpSubgroupAvcMceConvertToImeResultINTEL"; + case Op::OpSubgroupAvcMceConvertToRefPayloadINTEL: return "OpSubgroupAvcMceConvertToRefPayloadINTEL"; + case Op::OpSubgroupAvcMceConvertToRefResultINTEL: return "OpSubgroupAvcMceConvertToRefResultINTEL"; + case Op::OpSubgroupAvcMceConvertToSicPayloadINTEL: return "OpSubgroupAvcMceConvertToSicPayloadINTEL"; + case Op::OpSubgroupAvcMceConvertToSicResultINTEL: return "OpSubgroupAvcMceConvertToSicResultINTEL"; + case Op::OpSubgroupAvcMceGetMotionVectorsINTEL: return "OpSubgroupAvcMceGetMotionVectorsINTEL"; + case Op::OpSubgroupAvcMceGetInterDistortionsINTEL: return "OpSubgroupAvcMceGetInterDistortionsINTEL"; + case Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL: return "OpSubgroupAvcMceGetBestInterDistortionsINTEL"; + case Op::OpSubgroupAvcMceGetInterMajorShapeINTEL: return "OpSubgroupAvcMceGetInterMajorShapeINTEL"; + case Op::OpSubgroupAvcMceGetInterMinorShapeINTEL: return "OpSubgroupAvcMceGetInterMinorShapeINTEL"; + case Op::OpSubgroupAvcMceGetInterDirectionsINTEL: return "OpSubgroupAvcMceGetInterDirectionsINTEL"; + case Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL: return "OpSubgroupAvcMceGetInterMotionVectorCountINTEL"; + case Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL: return "OpSubgroupAvcMceGetInterReferenceIdsINTEL"; + case Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL"; + case Op::OpSubgroupAvcImeInitializeINTEL: return "OpSubgroupAvcImeInitializeINTEL"; + case Op::OpSubgroupAvcImeSetSingleReferenceINTEL: return "OpSubgroupAvcImeSetSingleReferenceINTEL"; + case Op::OpSubgroupAvcImeSetDualReferenceINTEL: return "OpSubgroupAvcImeSetDualReferenceINTEL"; + case Op::OpSubgroupAvcImeRefWindowSizeINTEL: return "OpSubgroupAvcImeRefWindowSizeINTEL"; + case Op::OpSubgroupAvcImeAdjustRefOffsetINTEL: return "OpSubgroupAvcImeAdjustRefOffsetINTEL"; + case Op::OpSubgroupAvcImeConvertToMcePayloadINTEL: return "OpSubgroupAvcImeConvertToMcePayloadINTEL"; + case Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: return "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL"; + case Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: return "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL"; + case Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: return "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL"; + case Op::OpSubgroupAvcImeSetWeightedSadINTEL: return "OpSubgroupAvcImeSetWeightedSadINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL"; + case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL"; + case Op::OpSubgroupAvcImeConvertToMceResultINTEL: return "OpSubgroupAvcImeConvertToMceResultINTEL"; + case Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL: return "OpSubgroupAvcImeGetDualReferenceStreaminINTEL"; + case Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL"; + case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL"; + case Op::OpSubgroupAvcImeGetBorderReachedINTEL: return "OpSubgroupAvcImeGetBorderReachedINTEL"; + case Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: return "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL"; + case Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: return "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL"; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL"; + case Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL"; + case Op::OpSubgroupAvcFmeInitializeINTEL: return "OpSubgroupAvcFmeInitializeINTEL"; + case Op::OpSubgroupAvcBmeInitializeINTEL: return "OpSubgroupAvcBmeInitializeINTEL"; + case Op::OpSubgroupAvcRefConvertToMcePayloadINTEL: return "OpSubgroupAvcRefConvertToMcePayloadINTEL"; + case Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: return "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL"; + case Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL: return "OpSubgroupAvcRefSetBilinearFilterEnableINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL"; + case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL"; + case Op::OpSubgroupAvcRefConvertToMceResultINTEL: return "OpSubgroupAvcRefConvertToMceResultINTEL"; + case Op::OpSubgroupAvcSicInitializeINTEL: return "OpSubgroupAvcSicInitializeINTEL"; + case Op::OpSubgroupAvcSicConfigureSkcINTEL: return "OpSubgroupAvcSicConfigureSkcINTEL"; + case Op::OpSubgroupAvcSicConfigureIpeLumaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaINTEL"; + case Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL"; + case Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL: return "OpSubgroupAvcSicGetMotionVectorMaskINTEL"; + case Op::OpSubgroupAvcSicConvertToMcePayloadINTEL: return "OpSubgroupAvcSicConvertToMcePayloadINTEL"; + case Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL"; + case Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL"; + case Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL"; + case Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL: return "OpSubgroupAvcSicSetBilinearFilterEnableINTEL"; + case Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: return "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL"; + case Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: return "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL"; + case Op::OpSubgroupAvcSicEvaluateIpeINTEL: return "OpSubgroupAvcSicEvaluateIpeINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL"; + case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL"; + case Op::OpSubgroupAvcSicConvertToMceResultINTEL: return "OpSubgroupAvcSicConvertToMceResultINTEL"; + case Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL: return "OpSubgroupAvcSicGetIpeLumaShapeINTEL"; + case Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL"; + case Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL"; + case Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: return "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL"; + case Op::OpSubgroupAvcSicGetIpeChromaModeINTEL: return "OpSubgroupAvcSicGetIpeChromaModeINTEL"; + case Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL"; + case Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL"; + case Op::OpSubgroupAvcSicGetInterRawSadsINTEL: return "OpSubgroupAvcSicGetInterRawSadsINTEL"; + case Op::OpVariableLengthArrayINTEL: return "OpVariableLengthArrayINTEL"; + case Op::OpSaveMemoryINTEL: return "OpSaveMemoryINTEL"; + case Op::OpRestoreMemoryINTEL: return "OpRestoreMemoryINTEL"; + case Op::OpArbitraryFloatSinCosPiINTEL: return "OpArbitraryFloatSinCosPiINTEL"; + case Op::OpArbitraryFloatCastINTEL: return "OpArbitraryFloatCastINTEL"; + case Op::OpArbitraryFloatCastFromIntINTEL: return "OpArbitraryFloatCastFromIntINTEL"; + case Op::OpArbitraryFloatCastToIntINTEL: return "OpArbitraryFloatCastToIntINTEL"; + case Op::OpArbitraryFloatAddINTEL: return "OpArbitraryFloatAddINTEL"; + case Op::OpArbitraryFloatSubINTEL: return "OpArbitraryFloatSubINTEL"; + case Op::OpArbitraryFloatMulINTEL: return "OpArbitraryFloatMulINTEL"; + case Op::OpArbitraryFloatDivINTEL: return "OpArbitraryFloatDivINTEL"; + case Op::OpArbitraryFloatGTINTEL: return "OpArbitraryFloatGTINTEL"; + case Op::OpArbitraryFloatGEINTEL: return "OpArbitraryFloatGEINTEL"; + case Op::OpArbitraryFloatLTINTEL: return "OpArbitraryFloatLTINTEL"; + case Op::OpArbitraryFloatLEINTEL: return "OpArbitraryFloatLEINTEL"; + case Op::OpArbitraryFloatEQINTEL: return "OpArbitraryFloatEQINTEL"; + case Op::OpArbitraryFloatRecipINTEL: return "OpArbitraryFloatRecipINTEL"; + case Op::OpArbitraryFloatRSqrtINTEL: return "OpArbitraryFloatRSqrtINTEL"; + case Op::OpArbitraryFloatCbrtINTEL: return "OpArbitraryFloatCbrtINTEL"; + case Op::OpArbitraryFloatHypotINTEL: return "OpArbitraryFloatHypotINTEL"; + case Op::OpArbitraryFloatSqrtINTEL: return "OpArbitraryFloatSqrtINTEL"; + case Op::OpArbitraryFloatLogINTEL: return "OpArbitraryFloatLogINTEL"; + case Op::OpArbitraryFloatLog2INTEL: return "OpArbitraryFloatLog2INTEL"; + case Op::OpArbitraryFloatLog10INTEL: return "OpArbitraryFloatLog10INTEL"; + case Op::OpArbitraryFloatLog1pINTEL: return "OpArbitraryFloatLog1pINTEL"; + case Op::OpArbitraryFloatExpINTEL: return "OpArbitraryFloatExpINTEL"; + case Op::OpArbitraryFloatExp2INTEL: return "OpArbitraryFloatExp2INTEL"; + case Op::OpArbitraryFloatExp10INTEL: return "OpArbitraryFloatExp10INTEL"; + case Op::OpArbitraryFloatExpm1INTEL: return "OpArbitraryFloatExpm1INTEL"; + case Op::OpArbitraryFloatSinINTEL: return "OpArbitraryFloatSinINTEL"; + case Op::OpArbitraryFloatCosINTEL: return "OpArbitraryFloatCosINTEL"; + case Op::OpArbitraryFloatSinCosINTEL: return "OpArbitraryFloatSinCosINTEL"; + case Op::OpArbitraryFloatSinPiINTEL: return "OpArbitraryFloatSinPiINTEL"; + case Op::OpArbitraryFloatCosPiINTEL: return "OpArbitraryFloatCosPiINTEL"; + case Op::OpArbitraryFloatASinINTEL: return "OpArbitraryFloatASinINTEL"; + case Op::OpArbitraryFloatASinPiINTEL: return "OpArbitraryFloatASinPiINTEL"; + case Op::OpArbitraryFloatACosINTEL: return "OpArbitraryFloatACosINTEL"; + case Op::OpArbitraryFloatACosPiINTEL: return "OpArbitraryFloatACosPiINTEL"; + case Op::OpArbitraryFloatATanINTEL: return "OpArbitraryFloatATanINTEL"; + case Op::OpArbitraryFloatATanPiINTEL: return "OpArbitraryFloatATanPiINTEL"; + case Op::OpArbitraryFloatATan2INTEL: return "OpArbitraryFloatATan2INTEL"; + case Op::OpArbitraryFloatPowINTEL: return "OpArbitraryFloatPowINTEL"; + case Op::OpArbitraryFloatPowRINTEL: return "OpArbitraryFloatPowRINTEL"; + case Op::OpArbitraryFloatPowNINTEL: return "OpArbitraryFloatPowNINTEL"; + case Op::OpLoopControlINTEL: return "OpLoopControlINTEL"; + case Op::OpAliasDomainDeclINTEL: return "OpAliasDomainDeclINTEL"; + case Op::OpAliasScopeDeclINTEL: return "OpAliasScopeDeclINTEL"; + case Op::OpAliasScopeListDeclINTEL: return "OpAliasScopeListDeclINTEL"; + case Op::OpFixedSqrtINTEL: return "OpFixedSqrtINTEL"; + case Op::OpFixedRecipINTEL: return "OpFixedRecipINTEL"; + case Op::OpFixedRsqrtINTEL: return "OpFixedRsqrtINTEL"; + case Op::OpFixedSinINTEL: return "OpFixedSinINTEL"; + case Op::OpFixedCosINTEL: return "OpFixedCosINTEL"; + case Op::OpFixedSinCosINTEL: return "OpFixedSinCosINTEL"; + case Op::OpFixedSinPiINTEL: return "OpFixedSinPiINTEL"; + case Op::OpFixedCosPiINTEL: return "OpFixedCosPiINTEL"; + case Op::OpFixedSinCosPiINTEL: return "OpFixedSinCosPiINTEL"; + case Op::OpFixedLogINTEL: return "OpFixedLogINTEL"; + case Op::OpFixedExpINTEL: return "OpFixedExpINTEL"; + case Op::OpPtrCastToCrossWorkgroupINTEL: return "OpPtrCastToCrossWorkgroupINTEL"; + case Op::OpCrossWorkgroupCastToPtrINTEL: return "OpCrossWorkgroupCastToPtrINTEL"; + case Op::OpReadPipeBlockingINTEL: return "OpReadPipeBlockingINTEL"; + case Op::OpWritePipeBlockingINTEL: return "OpWritePipeBlockingINTEL"; + case Op::OpFPGARegINTEL: return "OpFPGARegINTEL"; + case Op::OpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR"; + case Op::OpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR"; + case Op::OpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR"; + case Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR"; + case Op::OpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR"; + case Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR"; + case Op::OpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR"; + case Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR"; + case Op::OpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR"; + case Op::OpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR"; + case Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR"; + case Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR"; + case Op::OpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR"; + case Op::OpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR"; + case Op::OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR"; + case Op::OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR"; + case Op::OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR"; + case Op::OpAtomicFAddEXT: return "OpAtomicFAddEXT"; + case Op::OpTypeBufferSurfaceINTEL: return "OpTypeBufferSurfaceINTEL"; + case Op::OpTypeStructContinuedINTEL: return "OpTypeStructContinuedINTEL"; + case Op::OpConstantCompositeContinuedINTEL: return "OpConstantCompositeContinuedINTEL"; + case Op::OpSpecConstantCompositeContinuedINTEL: return "OpSpecConstantCompositeContinuedINTEL"; + case Op::OpCompositeConstructContinuedINTEL: return "OpCompositeConstructContinuedINTEL"; + case Op::OpConvertFToBF16INTEL: return "OpConvertFToBF16INTEL"; + case Op::OpConvertBF16ToFINTEL: return "OpConvertBF16ToFINTEL"; + case Op::OpControlBarrierArriveINTEL: return "OpControlBarrierArriveINTEL"; + case Op::OpControlBarrierWaitINTEL: return "OpControlBarrierWaitINTEL"; + case Op::OpArithmeticFenceEXT: return "OpArithmeticFenceEXT"; + case Op::OpSubgroupBlockPrefetchINTEL: return "OpSubgroupBlockPrefetchINTEL"; + case Op::OpSubgroup2DBlockLoadINTEL: return "OpSubgroup2DBlockLoadINTEL"; + case Op::OpSubgroup2DBlockLoadTransformINTEL: return "OpSubgroup2DBlockLoadTransformINTEL"; + case Op::OpSubgroup2DBlockLoadTransposeINTEL: return "OpSubgroup2DBlockLoadTransposeINTEL"; + case Op::OpSubgroup2DBlockPrefetchINTEL: return "OpSubgroup2DBlockPrefetchINTEL"; + case Op::OpSubgroup2DBlockStoreINTEL: return "OpSubgroup2DBlockStoreINTEL"; + case Op::OpSubgroupMatrixMultiplyAccumulateINTEL: return "OpSubgroupMatrixMultiplyAccumulateINTEL"; + case Op::OpGroupIMulKHR: return "OpGroupIMulKHR"; + case Op::OpGroupFMulKHR: return "OpGroupFMulKHR"; + case Op::OpGroupBitwiseAndKHR: return "OpGroupBitwiseAndKHR"; + case Op::OpGroupBitwiseOrKHR: return "OpGroupBitwiseOrKHR"; + case Op::OpGroupBitwiseXorKHR: return "OpGroupBitwiseXorKHR"; + case Op::OpGroupLogicalAndKHR: return "OpGroupLogicalAndKHR"; + case Op::OpGroupLogicalOrKHR: return "OpGroupLogicalOrKHR"; + case Op::OpGroupLogicalXorKHR: return "OpGroupLogicalXorKHR"; + case Op::OpMaskedGatherINTEL: return "OpMaskedGatherINTEL"; + case Op::OpMaskedScatterINTEL: return "OpMaskedScatterINTEL"; + default: return "Unknown"; + } +} + +#endif /* SPV_ENABLE_UTILITY_CODE */ + +// Overload bitwise operators for mask bit combining + +constexpr ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +constexpr ImageOperandsMask operator&(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) & unsigned(b)); } +constexpr ImageOperandsMask operator^(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr ImageOperandsMask operator~(ImageOperandsMask a) { return ImageOperandsMask(~unsigned(a)); } +constexpr FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +constexpr FPFastMathModeMask operator&(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) & unsigned(b)); } +constexpr FPFastMathModeMask operator^(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) ^ unsigned(b)); } +constexpr FPFastMathModeMask operator~(FPFastMathModeMask a) { return FPFastMathModeMask(~unsigned(a)); } +constexpr SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +constexpr SelectionControlMask operator&(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) & unsigned(b)); } +constexpr SelectionControlMask operator^(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) ^ unsigned(b)); } +constexpr SelectionControlMask operator~(SelectionControlMask a) { return SelectionControlMask(~unsigned(a)); } +constexpr LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +constexpr LoopControlMask operator&(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) & unsigned(b)); } +constexpr LoopControlMask operator^(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) ^ unsigned(b)); } +constexpr LoopControlMask operator~(LoopControlMask a) { return LoopControlMask(~unsigned(a)); } +constexpr FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +constexpr FunctionControlMask operator&(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) & unsigned(b)); } +constexpr FunctionControlMask operator^(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) ^ unsigned(b)); } +constexpr FunctionControlMask operator~(FunctionControlMask a) { return FunctionControlMask(~unsigned(a)); } +constexpr MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +constexpr MemorySemanticsMask operator&(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) & unsigned(b)); } +constexpr MemorySemanticsMask operator^(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) ^ unsigned(b)); } +constexpr MemorySemanticsMask operator~(MemorySemanticsMask a) { return MemorySemanticsMask(~unsigned(a)); } +constexpr MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +constexpr MemoryAccessMask operator&(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) & unsigned(b)); } +constexpr MemoryAccessMask operator^(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) ^ unsigned(b)); } +constexpr MemoryAccessMask operator~(MemoryAccessMask a) { return MemoryAccessMask(~unsigned(a)); } +constexpr KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } +constexpr KernelProfilingInfoMask operator&(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) & unsigned(b)); } +constexpr KernelProfilingInfoMask operator^(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) ^ unsigned(b)); } +constexpr KernelProfilingInfoMask operator~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask(~unsigned(a)); } +constexpr RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); } +constexpr RayFlagsMask operator&(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) & unsigned(b)); } +constexpr RayFlagsMask operator^(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) ^ unsigned(b)); } +constexpr RayFlagsMask operator~(RayFlagsMask a) { return RayFlagsMask(~unsigned(a)); } +constexpr FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); } +constexpr FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); } +constexpr FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); } +constexpr FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); } +constexpr CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); } +constexpr CooperativeMatrixReduceMask operator|(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) | unsigned(b)); } +constexpr CooperativeMatrixReduceMask operator&(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) & unsigned(b)); } +constexpr CooperativeMatrixReduceMask operator^(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) ^ unsigned(b)); } +constexpr CooperativeMatrixReduceMask operator~(CooperativeMatrixReduceMask a) { return CooperativeMatrixReduceMask(~unsigned(a)); } +constexpr TensorAddressingOperandsMask operator|(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) | unsigned(b)); } +constexpr TensorAddressingOperandsMask operator&(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) & unsigned(b)); } +constexpr TensorAddressingOperandsMask operator^(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr TensorAddressingOperandsMask operator~(TensorAddressingOperandsMask a) { return TensorAddressingOperandsMask(~unsigned(a)); } +constexpr TensorOperandsMask operator|(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) | unsigned(b)); } +constexpr TensorOperandsMask operator&(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) & unsigned(b)); } +constexpr TensorOperandsMask operator^(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr TensorOperandsMask operator~(TensorOperandsMask a) { return TensorOperandsMask(~unsigned(a)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator|(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) | unsigned(b)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator&(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) & unsigned(b)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator^(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr MatrixMultiplyAccumulateOperandsMask operator~(MatrixMultiplyAccumulateOperandsMask a) { return MatrixMultiplyAccumulateOperandsMask(~unsigned(a)); } +constexpr RawAccessChainOperandsMask operator|(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) | unsigned(b)); } +constexpr RawAccessChainOperandsMask operator&(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) & unsigned(b)); } +constexpr RawAccessChainOperandsMask operator^(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr RawAccessChainOperandsMask operator~(RawAccessChainOperandsMask a) { return RawAccessChainOperandsMask(~unsigned(a)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP + diff --git a/app/libs/ncnn/armeabi-v7a/include/glslang/build_info.h b/app/libs/ncnn/armeabi-v7a/include/glslang/build_info.h new file mode 100644 index 0000000..7816b66 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/glslang/build_info.h @@ -0,0 +1,62 @@ +// Copyright (C) 2020 The Khronos Group Inc. +// +// All rights reserved. +// +// 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. +// +// Neither the name of The Khronos Group Inc. 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 HOLDERS 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. + +#ifndef GLSLANG_BUILD_INFO +#define GLSLANG_BUILD_INFO + +#define GLSLANG_VERSION_MAJOR 16 +#define GLSLANG_VERSION_MINOR 1 +#define GLSLANG_VERSION_PATCH 0 +#define GLSLANG_VERSION_FLAVOR "" + +#define GLSLANG_VERSION_GREATER_THAN(major, minor, patch) \ + ((GLSLANG_VERSION_MAJOR) > (major) || ((major) == GLSLANG_VERSION_MAJOR && \ + ((GLSLANG_VERSION_MINOR) > (minor) || ((minor) == GLSLANG_VERSION_MINOR && \ + (GLSLANG_VERSION_PATCH) > (patch))))) + +#define GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch) \ + ((GLSLANG_VERSION_MAJOR) > (major) || ((major) == GLSLANG_VERSION_MAJOR && \ + ((GLSLANG_VERSION_MINOR) > (minor) || ((minor) == GLSLANG_VERSION_MINOR && \ + (GLSLANG_VERSION_PATCH >= (patch)))))) + +#define GLSLANG_VERSION_LESS_THAN(major, minor, patch) \ + ((GLSLANG_VERSION_MAJOR) < (major) || ((major) == GLSLANG_VERSION_MAJOR && \ + ((GLSLANG_VERSION_MINOR) < (minor) || ((minor) == GLSLANG_VERSION_MINOR && \ + (GLSLANG_VERSION_PATCH) < (patch))))) + +#define GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch) \ + ((GLSLANG_VERSION_MAJOR) < (major) || ((major) == GLSLANG_VERSION_MAJOR && \ + ((GLSLANG_VERSION_MINOR) < (minor) || ((minor) == GLSLANG_VERSION_MINOR && \ + (GLSLANG_VERSION_PATCH <= (patch)))))) + +#endif // GLSLANG_BUILD_INFO diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/allocator.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/allocator.h new file mode 100644 index 0000000..14ff4d5 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/allocator.h @@ -0,0 +1,442 @@ +// Copyright 2018 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_ALLOCATOR_H +#define NCNN_ALLOCATOR_H + +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif + +#include "platform.h" + +#include + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 +#include +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + +namespace ncnn { + +// the alignment of all the allocated buffers +#if NCNN_AVX512 +#define NCNN_MALLOC_ALIGN 64 +#elif NCNN_AVX +#define NCNN_MALLOC_ALIGN 32 +#else +#define NCNN_MALLOC_ALIGN 16 +#endif + +// we have some optimized kernels that may overread buffer a bit in loop +// it is common to interleave next-loop data load with arithmetic instructions +// allocating more bytes keeps us safe from SEGV_ACCERR failure +#define NCNN_MALLOC_OVERREAD 64 + +// Aligns a pointer to the specified number of bytes +// ptr Aligned pointer +// n Alignment size that must be a power of two +template +static NCNN_FORCEINLINE _Tp* alignPtr(_Tp* ptr, int n = (int)sizeof(_Tp)) +{ + return (_Tp*)(((size_t)ptr + n - 1) & -n); +} + +// Aligns a buffer size to the specified number of bytes +// The function returns the minimum number that is greater or equal to sz and is divisible by n +// sz Buffer size to align +// n Alignment size that must be a power of two +static NCNN_FORCEINLINE size_t alignSize(size_t sz, int n) +{ + return (sz + n - 1) & -n; +} + +static NCNN_FORCEINLINE void* fastMalloc(size_t size) +{ +#if _MSC_VER + return _aligned_malloc(size + NCNN_MALLOC_OVERREAD, NCNN_MALLOC_ALIGN); +#elif (defined(__unix__) || defined(__APPLE__)) && _POSIX_C_SOURCE >= 200112L || (__ANDROID__ && __ANDROID_API__ >= 17) + void* ptr = 0; + if (posix_memalign(&ptr, NCNN_MALLOC_ALIGN, size + NCNN_MALLOC_OVERREAD)) + ptr = 0; + return ptr; +#elif __ANDROID__ && __ANDROID_API__ < 17 + return memalign(NCNN_MALLOC_ALIGN, size + NCNN_MALLOC_OVERREAD); +#else + unsigned char* udata = (unsigned char*)malloc(size + sizeof(void*) + NCNN_MALLOC_ALIGN + NCNN_MALLOC_OVERREAD); + if (!udata) + return 0; + unsigned char** adata = alignPtr((unsigned char**)udata + 1, NCNN_MALLOC_ALIGN); + adata[-1] = udata; + return adata; +#endif +} + +static NCNN_FORCEINLINE void fastFree(void* ptr) +{ + if (ptr) + { +#if _MSC_VER + _aligned_free(ptr); +#elif (defined(__unix__) || defined(__APPLE__)) && _POSIX_C_SOURCE >= 200112L || (__ANDROID__ && __ANDROID_API__ >= 17) + free(ptr); +#elif __ANDROID__ && __ANDROID_API__ < 17 + free(ptr); +#else + unsigned char* udata = ((unsigned char**)ptr)[-1]; + free(udata); +#endif + } +} + +#if NCNN_THREADS +// exchange-add operation for atomic operations on reference counters +#if defined __riscv && !defined __riscv_atomic +// riscv target without A extension +static NCNN_FORCEINLINE int NCNN_XADD(int* addr, int delta) +{ + int tmp = *addr; + *addr += delta; + return tmp; +} +#elif defined __INTEL_COMPILER && !(defined WIN32 || defined _WIN32) +// atomic increment on the linux version of the Intel(tm) compiler +#define NCNN_XADD(addr, delta) (int)_InterlockedExchangeAdd(const_cast(reinterpret_cast(addr)), delta) +#elif defined __GNUC__ +#if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__) +#ifdef __ATOMIC_ACQ_REL +#define NCNN_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL) +#else +#define NCNN_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), delta, 4) +#endif +#else +#if defined __ATOMIC_ACQ_REL && !defined __clang__ +// version for gcc >= 4.7 +#define NCNN_XADD(addr, delta) (int)__atomic_fetch_add((unsigned*)(addr), (unsigned)(delta), __ATOMIC_ACQ_REL) +#else +#define NCNN_XADD(addr, delta) (int)__sync_fetch_and_add((unsigned*)(addr), (unsigned)(delta)) +#endif +#endif +#elif defined _MSC_VER && !defined RC_INVOKED +#define NCNN_XADD(addr, delta) (int)_InterlockedExchangeAdd((long volatile*)addr, delta) +#else +// thread-unsafe branch +static NCNN_FORCEINLINE int NCNN_XADD(int* addr, int delta) +{ + int tmp = *addr; + *addr += delta; + return tmp; +} +#endif +#else // NCNN_THREADS +static NCNN_FORCEINLINE int NCNN_XADD(int* addr, int delta) +{ + int tmp = *addr; + *addr += delta; + return tmp; +} +#endif // NCNN_THREADS + +class NCNN_EXPORT Allocator +{ +public: + virtual ~Allocator(); + virtual void* fastMalloc(size_t size) = 0; + virtual void fastFree(void* ptr) = 0; +}; + +class PoolAllocatorPrivate; +class NCNN_EXPORT PoolAllocator : public Allocator +{ +public: + PoolAllocator(); + ~PoolAllocator(); + + // ratio range 0 ~ 1 + // default cr = 0 + void set_size_compare_ratio(float scr); + + // budget drop threshold + // default threshold = 10 + void set_size_drop_threshold(size_t); + + // release all budgets immediately + void clear(); + + virtual void* fastMalloc(size_t size); + virtual void fastFree(void* ptr); + +private: + PoolAllocator(const PoolAllocator&); + PoolAllocator& operator=(const PoolAllocator&); + +private: + PoolAllocatorPrivate* const d; +}; + +class UnlockedPoolAllocatorPrivate; +class NCNN_EXPORT UnlockedPoolAllocator : public Allocator +{ +public: + UnlockedPoolAllocator(); + ~UnlockedPoolAllocator(); + + // ratio range 0 ~ 1 + // default cr = 0 + void set_size_compare_ratio(float scr); + + // budget drop threshold + // default threshold = 10 + void set_size_drop_threshold(size_t); + + // release all budgets immediately + void clear(); + + virtual void* fastMalloc(size_t size); + virtual void fastFree(void* ptr); + +private: + UnlockedPoolAllocator(const UnlockedPoolAllocator&); + UnlockedPoolAllocator& operator=(const UnlockedPoolAllocator&); + +private: + UnlockedPoolAllocatorPrivate* const d; +}; + +#if NCNN_VULKAN + +class VulkanDevice; + +class NCNN_EXPORT VkBufferMemory +{ +public: + VkBuffer buffer; + + // the base offset assigned by allocator + size_t offset; + size_t capacity; + + VkDeviceMemory memory; + void* mapped_ptr; + + uint32_t memory_type_index; + + // buffer state, modified by command functions internally + mutable VkAccessFlags access_flags; + mutable VkPipelineStageFlags stage_flags; + + // initialize and modified by mat + int refcount; +}; + +class NCNN_EXPORT VkImageMemory +{ +public: + VkImage image; + VkImageView imageview; + + // underlying info assigned by allocator + int width; + int height; + int depth; + VkFormat format; + + VkDeviceMemory memory; + void* mapped_ptr; + + uint32_t memory_type_index; + + // the base offset assigned by allocator + size_t bind_offset; + size_t bind_capacity; + + // image state, modified by command functions internally + mutable VkAccessFlags access_flags; + mutable VkImageLayout image_layout; + mutable VkPipelineStageFlags stage_flags; + + // in-execution state, modified by command functions internally + mutable int command_refcount; + + // initialize and modified by mat + int refcount; +}; + +class NCNN_EXPORT VkAllocator +{ +public: + explicit VkAllocator(const VulkanDevice* _vkdev); + virtual ~VkAllocator(); + + virtual void clear(); + + virtual VkBufferMemory* fastMalloc(size_t size) = 0; + virtual void fastFree(VkBufferMemory* ptr) = 0; + virtual int flush(VkBufferMemory* ptr); + virtual int invalidate(VkBufferMemory* ptr); + + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack) = 0; + virtual void fastFree(VkImageMemory* ptr) = 0; + +public: + const VulkanDevice* vkdev; + uint32_t buffer_memory_type_index; + uint32_t image_memory_type_index; + uint32_t reserved_type_index; + bool mappable; + bool coherent; + +protected: + VkBuffer create_buffer(size_t size, VkBufferUsageFlags usage); + VkDeviceMemory allocate_memory(size_t size, uint32_t memory_type_index); + VkDeviceMemory allocate_dedicated_memory(size_t size, uint32_t memory_type_index, VkImage image, VkBuffer buffer); + VkDeviceMemory allocate_import_host_memory(size_t size, uint32_t memory_type_index, void* host_ptr); + + VkImage create_image(int width, int height, int depth, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage); + VkImageView create_imageview(VkImage image, VkFormat format); +}; + +class VkBlobAllocatorPrivate; +class NCNN_EXPORT VkBlobAllocator : public VkAllocator +{ +public: + explicit VkBlobAllocator(const VulkanDevice* vkdev, size_t preferred_block_size = 16 * 1024 * 1024); // 16M + virtual ~VkBlobAllocator(); + +public: + // release all budgets immediately + virtual void clear(); + + virtual VkBufferMemory* fastMalloc(size_t size); + virtual void fastFree(VkBufferMemory* ptr); + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack); + virtual void fastFree(VkImageMemory* ptr); + +private: + VkBlobAllocator(const VkBlobAllocator&); + VkBlobAllocator& operator=(const VkBlobAllocator&); + +private: + VkBlobAllocatorPrivate* const d; +}; + +class VkWeightAllocatorPrivate; +class NCNN_EXPORT VkWeightAllocator : public VkAllocator +{ +public: + explicit VkWeightAllocator(const VulkanDevice* vkdev, bool prefer_host_memory = false, size_t preferred_block_size = 8 * 1024 * 1024); // 8M + explicit VkWeightAllocator(const VulkanDevice* vkdev, size_t preferred_block_size) + : VkWeightAllocator(vkdev, false, preferred_block_size) + { + } + virtual ~VkWeightAllocator(); + +public: + // release all blocks immediately + virtual void clear(); + +public: + virtual VkBufferMemory* fastMalloc(size_t size); + virtual void fastFree(VkBufferMemory* ptr); + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack); + virtual void fastFree(VkImageMemory* ptr); + +private: + VkWeightAllocator(const VkWeightAllocator&); + VkWeightAllocator& operator=(const VkWeightAllocator&); + +private: + VkWeightAllocatorPrivate* const d; +}; + +class VkStagingAllocatorPrivate; +class NCNN_EXPORT VkStagingAllocator : public VkAllocator +{ +public: + explicit VkStagingAllocator(const VulkanDevice* vkdev); + virtual ~VkStagingAllocator(); + +public: + // ratio range 0 ~ 1 + // default cr = 0.75 + void set_size_compare_ratio(float scr); + + // release all budgets immediately + virtual void clear(); + + virtual VkBufferMemory* fastMalloc(size_t size); + virtual void fastFree(VkBufferMemory* ptr); + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack); + virtual void fastFree(VkImageMemory* ptr); + +private: + VkStagingAllocator(const VkStagingAllocator&); + VkStagingAllocator& operator=(const VkStagingAllocator&); + +private: + VkStagingAllocatorPrivate* const d; +}; + +class VkWeightStagingAllocatorPrivate; +class NCNN_EXPORT VkWeightStagingAllocator : public VkAllocator +{ +public: + explicit VkWeightStagingAllocator(const VulkanDevice* vkdev); + virtual ~VkWeightStagingAllocator(); + +public: + virtual VkBufferMemory* fastMalloc(size_t size); + virtual void fastFree(VkBufferMemory* ptr); + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack); + virtual void fastFree(VkImageMemory* ptr); + +private: + VkWeightStagingAllocator(const VkWeightStagingAllocator&); + VkWeightStagingAllocator& operator=(const VkWeightStagingAllocator&); + +private: + VkWeightStagingAllocatorPrivate* const d; +}; + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 +class NCNN_EXPORT VkAndroidHardwareBufferImageAllocator : public VkAllocator +{ +public: + VkAndroidHardwareBufferImageAllocator(const VulkanDevice* _vkdev, AHardwareBuffer* _hb); + virtual ~VkAndroidHardwareBufferImageAllocator(); + +public: + virtual VkBufferMemory* fastMalloc(size_t size); + virtual void fastFree(VkBufferMemory* ptr); + virtual VkImageMemory* fastMalloc(int w, int h, int c, size_t elemsize, int elempack); + virtual void fastFree(VkImageMemory* ptr); + +private: + VkAndroidHardwareBufferImageAllocator(const VkAndroidHardwareBufferImageAllocator&); + VkAndroidHardwareBufferImageAllocator& operator=(const VkAndroidHardwareBufferImageAllocator&); + +public: + int init(); + + int width() const; + int height() const; + uint64_t external_format() const; + +public: + AHardwareBuffer* hb; + AHardwareBuffer_Desc bufferDesc; + VkAndroidHardwareBufferFormatPropertiesANDROID bufferFormatProperties; + VkAndroidHardwareBufferPropertiesANDROID bufferProperties; + VkSamplerYcbcrConversionKHR samplerYcbcrConversion; +}; +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + +#endif // NCNN_VULKAN + +} // namespace ncnn + +#endif // NCNN_ALLOCATOR_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/benchmark.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/benchmark.h new file mode 100644 index 0000000..5df5026 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/benchmark.h @@ -0,0 +1,28 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_BENCHMARK_H +#define NCNN_BENCHMARK_H + +#include "layer.h" +#include "mat.h" +#include "platform.h" + +namespace ncnn { + +// get now timestamp in ms +NCNN_EXPORT double get_current_time(); + +// sleep milliseconds +NCNN_EXPORT void sleep(unsigned long long int milliseconds = 1000); + +#if NCNN_BENCHMARK + +NCNN_EXPORT void benchmark(const Layer* layer, double start, double end); +NCNN_EXPORT void benchmark(const Layer* layer, const Mat& bottom_blob, Mat& top_blob, double start, double end); + +#endif // NCNN_BENCHMARK + +} // namespace ncnn + +#endif // NCNN_BENCHMARK_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/blob.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/blob.h new file mode 100644 index 0000000..212e719 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/blob.h @@ -0,0 +1,33 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_BLOB_H +#define NCNN_BLOB_H + +#include "mat.h" +#include "platform.h" + +namespace ncnn { + +class NCNN_EXPORT Blob +{ +public: + // empty + Blob(); + +public: +#if NCNN_STRING + // blob name + std::string name; +#endif // NCNN_STRING + // layer index which produce this blob as output + int producer; + // layer index which need this blob as input + int consumer; + // shape hint + Mat shape; +}; + +} // namespace ncnn + +#endif // NCNN_BLOB_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/c_api.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/c_api.h new file mode 100644 index 0000000..918cced --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/c_api.h @@ -0,0 +1,424 @@ +/* Copyright 2020 Tencent + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef NCNN_C_API_H +#define NCNN_C_API_H + +#include "platform.h" + +#if NCNN_C_API + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +NCNN_EXPORT const char* ncnn_version(void); +NCNN_EXPORT int ncnn_version_number(void); + +/* allocator api */ +typedef struct __ncnn_allocator_t* ncnn_allocator_t; +struct NCNN_EXPORT __ncnn_allocator_t +{ + void* pthis; + + void* (*fast_malloc)(ncnn_allocator_t allocator, size_t size); + void (*fast_free)(ncnn_allocator_t allocator, void* ptr); +}; + +NCNN_EXPORT ncnn_allocator_t ncnn_allocator_create_pool_allocator(void); +NCNN_EXPORT ncnn_allocator_t ncnn_allocator_create_unlocked_pool_allocator(void); +NCNN_EXPORT void ncnn_allocator_destroy(ncnn_allocator_t allocator); + +#if NCNN_VULKAN +/* pipelinecache api */ +typedef struct __ncnn_pipelinecache_t* ncnn_pipelinecache_t; + +NCNN_EXPORT ncnn_pipelinecache_t ncnn_pipelinecache_create(int device_index); +NCNN_EXPORT void ncnn_pipelinecache_destroy(ncnn_pipelinecache_t pipelinecache); +NCNN_EXPORT void ncnn_pipelinecache_clear(ncnn_pipelinecache_t pipelinecache); +NCNN_EXPORT size_t ncnn_pipelinecache_get_size(const ncnn_pipelinecache_t pipelinecache); +NCNN_EXPORT int ncnn_pipelinecache_load_memory(ncnn_pipelinecache_t pipelinecache, const unsigned char* data, size_t size); +NCNN_EXPORT int ncnn_pipelinecache_save_memory(const ncnn_pipelinecache_t pipelinecache, unsigned char* data, size_t* size); +#if NCNN_STDIO +NCNN_EXPORT int ncnn_pipelinecache_load(ncnn_pipelinecache_t pipelinecache, const char* path); +NCNN_EXPORT int ncnn_pipelinecache_save(const ncnn_pipelinecache_t pipelinecache, const char* path); +#if _WIN32 +NCNN_EXPORT int ncnn_pipelinecache_load_w(ncnn_pipelinecache_t pipelinecache, const wchar_t* path); +NCNN_EXPORT int ncnn_pipelinecache_save_w(const ncnn_pipelinecache_t pipelinecache, const wchar_t* path); +#endif /* _WIN32 */ +#endif /* NCNN_STDIO */ +#endif /* NCNN_VULKAN */ + +/* option api */ +typedef struct __ncnn_option_t* ncnn_option_t; + +NCNN_EXPORT ncnn_option_t ncnn_option_create(void); +NCNN_EXPORT void ncnn_option_destroy(ncnn_option_t opt); + +NCNN_EXPORT int ncnn_option_get_num_threads(const ncnn_option_t opt); +NCNN_EXPORT void ncnn_option_set_num_threads(ncnn_option_t opt, int num_threads); + +NCNN_EXPORT void ncnn_option_set_blob_allocator(ncnn_option_t opt, ncnn_allocator_t allocator); +NCNN_EXPORT void ncnn_option_set_workspace_allocator(ncnn_option_t opt, ncnn_allocator_t allocator); + +NCNN_EXPORT int ncnn_option_get_use_vulkan_compute(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_local_pool_allocator(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_winograd_convolution(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_sgemm_convolution(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_packing_layout(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_fp16_packed(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_fp16_storage(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_fp16_arithmetic(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_int8_packed(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_int8_storage(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_int8_arithmetic(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_bf16_packed(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_bf16_storage(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_shader_local_memory(const ncnn_option_t opt); +NCNN_EXPORT int ncnn_option_get_use_cooperative_matrix(const ncnn_option_t opt); + +NCNN_EXPORT void ncnn_option_set_use_vulkan_compute(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_local_pool_allocator(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_winograd_convolution(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_sgemm_convolution(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_packing_layout(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_fp16_packed(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_fp16_storage(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_fp16_arithmetic(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_int8_packed(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_int8_storage(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_int8_arithmetic(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_bf16_packed(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_bf16_storage(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_shader_local_memory(ncnn_option_t opt, int enable); +NCNN_EXPORT void ncnn_option_set_use_cooperative_matrix(ncnn_option_t opt, int enable); +#if NCNN_VULKAN +NCNN_EXPORT void ncnn_option_set_pipeline_cache(ncnn_option_t opt, ncnn_pipelinecache_t pipelinecache); +#endif /* NCNN_VULKAN */ + +/* mat api */ +typedef struct __ncnn_mat_t* ncnn_mat_t; + +NCNN_EXPORT ncnn_mat_t ncnn_mat_create(void); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_1d(int w, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_2d(int w, int h, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_3d(int w, int h, int c, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_4d(int w, int h, int d, int c, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_1d(int w, void* data, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_2d(int w, int h, void* data, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_3d(int w, int h, int c, void* data, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_4d(int w, int h, int d, int c, void* data, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_1d_elem(int w, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_2d_elem(int w, int h, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_3d_elem(int w, int h, int c, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_4d_elem(int w, int h, int d, int c, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_1d_elem(int w, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_2d_elem(int w, int h, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_3d_elem(int w, int h, int c, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_4d_elem(int w, int h, int d, int c, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator); +NCNN_EXPORT void ncnn_mat_destroy(ncnn_mat_t mat); + +NCNN_EXPORT void ncnn_mat_fill_float(ncnn_mat_t mat, float v); + +NCNN_EXPORT ncnn_mat_t ncnn_mat_clone(const ncnn_mat_t mat, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_1d(const ncnn_mat_t mat, int w, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_2d(const ncnn_mat_t mat, int w, int h, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_3d(const ncnn_mat_t mat, int w, int h, int c, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_4d(const ncnn_mat_t mat, int w, int h, int d, int c, ncnn_allocator_t allocator); + +NCNN_EXPORT int ncnn_mat_get_dims(const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_mat_get_w(const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_mat_get_h(const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_mat_get_d(const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_mat_get_c(const ncnn_mat_t mat); +NCNN_EXPORT size_t ncnn_mat_get_elemsize(const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_mat_get_elempack(const ncnn_mat_t mat); +NCNN_EXPORT size_t ncnn_mat_get_cstep(const ncnn_mat_t mat); +NCNN_EXPORT void* ncnn_mat_get_data(const ncnn_mat_t mat); + +NCNN_EXPORT void* ncnn_mat_get_channel_data(const ncnn_mat_t mat, int c); + +#if NCNN_PIXEL + +/* mat pixel api */ +#define NCNN_MAT_PIXEL_RGB 1 +#define NCNN_MAT_PIXEL_BGR 2 +#define NCNN_MAT_PIXEL_GRAY 3 +#define NCNN_MAT_PIXEL_RGBA 4 +#define NCNN_MAT_PIXEL_BGRA 5 +#define NCNN_MAT_PIXEL_X2Y(X, Y) (X | (Y << 16)) +NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels(const unsigned char* pixels, int type, int w, int h, int stride, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels_resize(const unsigned char* pixels, int type, int w, int h, int stride, int target_width, int target_height, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels_roi(const unsigned char* pixels, int type, int w, int h, int stride, int roix, int roiy, int roiw, int roih, ncnn_allocator_t allocator); +NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels_roi_resize(const unsigned char* pixels, int type, int w, int h, int stride, int roix, int roiy, int roiw, int roih, int target_width, int target_height, ncnn_allocator_t allocator); +NCNN_EXPORT void ncnn_mat_to_pixels(const ncnn_mat_t mat, unsigned char* pixels, int type, int stride); +NCNN_EXPORT void ncnn_mat_to_pixels_resize(const ncnn_mat_t mat, unsigned char* pixels, int type, int target_width, int target_height, int target_stride); + +#endif /* NCNN_PIXEL */ + +NCNN_EXPORT void ncnn_mat_substract_mean_normalize(ncnn_mat_t mat, const float* mean_vals, const float* norm_vals); + +NCNN_EXPORT void ncnn_convert_packing(const ncnn_mat_t src, ncnn_mat_t* dst, int elempack, const ncnn_option_t opt); +NCNN_EXPORT void ncnn_flatten(const ncnn_mat_t src, ncnn_mat_t* dst, const ncnn_option_t opt); + +/* blob api */ +typedef struct __ncnn_blob_t* ncnn_blob_t; + +#if NCNN_STRING +NCNN_EXPORT const char* ncnn_blob_get_name(const ncnn_blob_t blob); +#endif /* NCNN_STRING */ + +NCNN_EXPORT int ncnn_blob_get_producer(const ncnn_blob_t blob); +NCNN_EXPORT int ncnn_blob_get_consumer(const ncnn_blob_t blob); + +NCNN_EXPORT void ncnn_blob_get_shape(const ncnn_blob_t blob, int* dims, int* w, int* h, int* c); + +/* paramdict api */ +typedef struct __ncnn_paramdict_t* ncnn_paramdict_t; + +NCNN_EXPORT ncnn_paramdict_t ncnn_paramdict_create(void); +NCNN_EXPORT void ncnn_paramdict_destroy(ncnn_paramdict_t pd); + +NCNN_EXPORT int ncnn_paramdict_get_type(const ncnn_paramdict_t pd, int id); + +NCNN_EXPORT int ncnn_paramdict_get_int(const ncnn_paramdict_t pd, int id, int def); +NCNN_EXPORT float ncnn_paramdict_get_float(const ncnn_paramdict_t pd, int id, float def); +NCNN_EXPORT ncnn_mat_t ncnn_paramdict_get_array(const ncnn_paramdict_t pd, int id, const ncnn_mat_t def); + +NCNN_EXPORT void ncnn_paramdict_set_int(ncnn_paramdict_t pd, int id, int i); +NCNN_EXPORT void ncnn_paramdict_set_float(ncnn_paramdict_t pd, int id, float f); +NCNN_EXPORT void ncnn_paramdict_set_array(ncnn_paramdict_t pd, int id, const ncnn_mat_t v); + +/* datareader api */ +typedef struct __ncnn_datareader_t* ncnn_datareader_t; +struct NCNN_EXPORT __ncnn_datareader_t +{ + void* pthis; + +#if NCNN_STRING + int (*scan)(ncnn_datareader_t dr, const char* format, void* p); +#endif /* NCNN_STRING */ + size_t (*read)(ncnn_datareader_t dr, void* buf, size_t size); +}; + +NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create(void); +#if NCNN_STDIO +NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create_from_stdio(FILE* fp); +#endif /* NCNN_STDIO */ +NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create_from_memory(const unsigned char** mem); +NCNN_EXPORT void ncnn_datareader_destroy(ncnn_datareader_t dr); + +/* modelbin api */ +typedef struct __ncnn_modelbin_t* ncnn_modelbin_t; +struct NCNN_EXPORT __ncnn_modelbin_t +{ + void* pthis; + + ncnn_mat_t (*load_1d)(const ncnn_modelbin_t mb, int w, int type); + ncnn_mat_t (*load_2d)(const ncnn_modelbin_t mb, int w, int h, int type); + ncnn_mat_t (*load_3d)(const ncnn_modelbin_t mb, int w, int h, int c, int type); +}; + +NCNN_EXPORT ncnn_modelbin_t ncnn_modelbin_create_from_datareader(const ncnn_datareader_t dr); +NCNN_EXPORT ncnn_modelbin_t ncnn_modelbin_create_from_mat_array(const ncnn_mat_t* weights, int n); +NCNN_EXPORT void ncnn_modelbin_destroy(ncnn_modelbin_t mb); + +/* layer api */ +typedef struct __ncnn_layer_t* ncnn_layer_t; +struct NCNN_EXPORT __ncnn_layer_t +{ + void* pthis; + + int (*load_param)(ncnn_layer_t layer, const ncnn_paramdict_t pd); + int (*load_model)(ncnn_layer_t layer, const ncnn_modelbin_t mb); + + int (*create_pipeline)(ncnn_layer_t layer, const ncnn_option_t opt); + int (*destroy_pipeline)(ncnn_layer_t layer, const ncnn_option_t opt); + + int (*forward_1)(const ncnn_layer_t layer, const ncnn_mat_t bottom_blob, ncnn_mat_t* top_blob, const ncnn_option_t opt); + int (*forward_n)(const ncnn_layer_t layer, const ncnn_mat_t* bottom_blobs, int n, ncnn_mat_t* top_blobs, int n2, const ncnn_option_t opt); + + int (*forward_inplace_1)(const ncnn_layer_t layer, ncnn_mat_t bottom_top_blob, const ncnn_option_t opt); + int (*forward_inplace_n)(const ncnn_layer_t layer, ncnn_mat_t* bottom_top_blobs, int n, const ncnn_option_t opt); +}; + +NCNN_EXPORT ncnn_layer_t ncnn_layer_create(void); +NCNN_EXPORT ncnn_layer_t ncnn_layer_create_by_typeindex(int typeindex); +#if NCNN_STRING +NCNN_EXPORT ncnn_layer_t ncnn_layer_create_by_type(const char* type); +NCNN_EXPORT int ncnn_layer_type_to_index(const char* type); +#endif /* NCNN_STRING */ +NCNN_EXPORT void ncnn_layer_destroy(ncnn_layer_t layer); + +#if NCNN_STRING +NCNN_EXPORT const char* ncnn_layer_get_name(const ncnn_layer_t layer); +#endif /* NCNN_STRING */ + +NCNN_EXPORT int ncnn_layer_get_typeindex(const ncnn_layer_t layer); +#if NCNN_STRING +NCNN_EXPORT const char* ncnn_layer_get_type(const ncnn_layer_t layer); +#endif /* NCNN_STRING */ + +NCNN_EXPORT int ncnn_layer_get_one_blob_only(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_inplace(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_vulkan(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_packing(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_bf16_storage(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_fp16_storage(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_vulkan_packing(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_any_packing(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_support_vulkan_any_packing(const ncnn_layer_t layer); + +NCNN_EXPORT void ncnn_layer_set_one_blob_only(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_inplace(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_vulkan(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_packing(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_bf16_storage(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_fp16_storage(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_vulkan_packing(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_any_packing(ncnn_layer_t layer, int enable); +NCNN_EXPORT void ncnn_layer_set_support_vulkan_any_packing(ncnn_layer_t layer, int enable); + +NCNN_EXPORT int ncnn_layer_get_bottom_count(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_bottom(const ncnn_layer_t layer, int i); +NCNN_EXPORT int ncnn_layer_get_top_count(const ncnn_layer_t layer); +NCNN_EXPORT int ncnn_layer_get_top(const ncnn_layer_t layer, int i); + +NCNN_EXPORT void ncnn_blob_get_bottom_shape(const ncnn_layer_t layer, int i, int* dims, int* w, int* h, int* c); +NCNN_EXPORT void ncnn_blob_get_top_shape(const ncnn_layer_t layer, int i, int* dims, int* w, int* h, int* c); + +/* layer factory function */ +typedef ncnn_layer_t (*ncnn_layer_creator_t)(void* userdata); +typedef void (*ncnn_layer_destroyer_t)(ncnn_layer_t layer, void* userdata); + +typedef struct __ncnn_net_custom_layer_factory_t* ncnn_net_custom_layer_factory_t; +struct __ncnn_net_custom_layer_factory_t +{ + ncnn_layer_creator_t creator; + ncnn_layer_destroyer_t destroyer; + void* userdata; + ncnn_net_custom_layer_factory_t next; +}; + +/* net api */ +typedef struct __ncnn_net_t* ncnn_net_t; +struct __ncnn_net_t +{ + void* pthis; + + ncnn_net_custom_layer_factory_t custom_layer_factory; +}; + +NCNN_EXPORT ncnn_net_t ncnn_net_create(void); +NCNN_EXPORT void ncnn_net_destroy(ncnn_net_t net); + +NCNN_EXPORT ncnn_option_t ncnn_net_get_option(ncnn_net_t net); +NCNN_EXPORT void ncnn_net_set_option(ncnn_net_t net, ncnn_option_t opt); + +#if NCNN_VULKAN +NCNN_EXPORT void ncnn_net_set_vulkan_device(ncnn_net_t net, int device_index); +#endif + +#if NCNN_STRING +NCNN_EXPORT void ncnn_net_register_custom_layer_by_type(ncnn_net_t net, const char* type, ncnn_layer_creator_t creator, ncnn_layer_destroyer_t destroyer, void* userdata); +#endif /* NCNN_STRING */ +NCNN_EXPORT void ncnn_net_register_custom_layer_by_typeindex(ncnn_net_t net, int typeindex, ncnn_layer_creator_t creator, ncnn_layer_destroyer_t destroyer, void* userdata); + +#if NCNN_STDIO +#if NCNN_STRING +NCNN_EXPORT int ncnn_net_load_param(ncnn_net_t net, const char* path); +#endif /* NCNN_STRING */ +NCNN_EXPORT int ncnn_net_load_param_bin(ncnn_net_t net, const char* path); +NCNN_EXPORT int ncnn_net_load_model(ncnn_net_t net, const char* path); +#if _WIN32 +#if NCNN_STRING +NCNN_EXPORT int ncnn_net_load_param_w(ncnn_net_t net, const wchar_t* path); +#endif /* NCNN_STRING */ +NCNN_EXPORT int ncnn_net_load_param_bin_w(ncnn_net_t net, const wchar_t* path); +NCNN_EXPORT int ncnn_net_load_model_w(ncnn_net_t net, const wchar_t* path); +#endif /* _WIN32 */ +#endif /* NCNN_STDIO */ + +#if NCNN_STDIO +#if NCNN_STRING +NCNN_EXPORT int ncnn_net_load_param_memory(ncnn_net_t net, const char* mem); +#endif /* NCNN_STRING */ +#endif /* NCNN_STDIO */ +NCNN_EXPORT size_t ncnn_net_load_param_bin_memory(ncnn_net_t net, const unsigned char* mem); +NCNN_EXPORT size_t ncnn_net_load_model_memory(ncnn_net_t net, const unsigned char* mem); + +#if NCNN_STRING +NCNN_EXPORT int ncnn_net_load_param_datareader(ncnn_net_t net, const ncnn_datareader_t dr); +#endif /* NCNN_STRING */ +NCNN_EXPORT int ncnn_net_load_param_bin_datareader(ncnn_net_t net, const ncnn_datareader_t dr); +NCNN_EXPORT int ncnn_net_load_model_datareader(ncnn_net_t net, const ncnn_datareader_t dr); + +NCNN_EXPORT void ncnn_net_clear(ncnn_net_t net); + +NCNN_EXPORT int ncnn_net_get_input_count(const ncnn_net_t net); +NCNN_EXPORT int ncnn_net_get_output_count(const ncnn_net_t net); +#if NCNN_STRING +NCNN_EXPORT const char* ncnn_net_get_input_name(const ncnn_net_t net, int i); +NCNN_EXPORT const char* ncnn_net_get_output_name(const ncnn_net_t net, int i); +#endif /* NCNN_STRING */ +NCNN_EXPORT int ncnn_net_get_input_index(const ncnn_net_t net, int i); +NCNN_EXPORT int ncnn_net_get_output_index(const ncnn_net_t net, int i); + +/* extractor api */ +typedef struct __ncnn_extractor_t* ncnn_extractor_t; + +NCNN_EXPORT ncnn_extractor_t ncnn_extractor_create(ncnn_net_t net); +NCNN_EXPORT void ncnn_extractor_destroy(ncnn_extractor_t ex); + +NCNN_EXPORT void ncnn_extractor_set_option(ncnn_extractor_t ex, const ncnn_option_t opt); + +#if NCNN_STRING +NCNN_EXPORT int ncnn_extractor_input(ncnn_extractor_t ex, const char* name, const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_extractor_extract(ncnn_extractor_t ex, const char* name, ncnn_mat_t* mat); +#endif /* NCNN_STRING */ +NCNN_EXPORT int ncnn_extractor_input_index(ncnn_extractor_t ex, int index, const ncnn_mat_t mat); +NCNN_EXPORT int ncnn_extractor_extract_index(ncnn_extractor_t ex, int index, ncnn_mat_t* mat); + +/* mat process api */ +#define NCNN_BORDER_CONSTANT 0 +#define NCNN_BORDER_REPLICATE 1 +#define NCNN_BORDER_REFLECT 2 +#define NCNN_BORDER_TRANSPARENT -233 +NCNN_EXPORT void ncnn_copy_make_border(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, int type, float v, const ncnn_option_t opt); +NCNN_EXPORT void ncnn_copy_make_border_3d(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, int front, int behind, int type, float v, const ncnn_option_t opt); +NCNN_EXPORT void ncnn_copy_cut_border(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, const ncnn_option_t opt); +NCNN_EXPORT void ncnn_copy_cut_border_3d(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, int front, int behind, const ncnn_option_t opt); + +#if NCNN_PIXEL_DRAWING +/* mat pixel drawing api*/ +NCNN_EXPORT void ncnn_draw_rectangle_c1(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_rectangle_c2(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_rectangle_c3(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_rectangle_c4(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); + +NCNN_EXPORT void ncnn_draw_text_c1(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void ncnn_draw_text_c2(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void ncnn_draw_text_c3(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void ncnn_draw_text_c4(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); + +NCNN_EXPORT void ncnn_draw_circle_c1(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_circle_c2(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_circle_c3(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_circle_c4(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); + +NCNN_EXPORT void ncnn_draw_line_c1(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_line_c2(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_line_c3(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void ncnn_draw_line_c4(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +#endif /* NCNN_PIXEL_DRAWING */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* NCNN_C_API */ + +#endif /* NCNN_C_API_H */ diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/command.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/command.h new file mode 100644 index 0000000..a673823 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/command.h @@ -0,0 +1,117 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_COMMAND_H +#define NCNN_COMMAND_H + +#include "platform.h" + +#if NCNN_VULKAN + +#include "mat.h" + +namespace ncnn { + +class Pipeline; +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 +class ImportAndroidHardwareBufferPipeline; +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API +class VkComputePrivate; +class NCNN_EXPORT VkCompute +{ +public: + explicit VkCompute(const VulkanDevice* vkdev); + virtual ~VkCompute(); + +public: + void record_upload(const Mat& src, VkMat& dst, const Option& opt); + + void record_download(const VkMat& src, Mat& dst, const Option& opt); + + void record_clone(const Mat& src, VkMat& dst, const Option& opt); + + void record_clone(const Mat& src, VkImageMat& dst, const Option& opt); + + void record_clone(const VkMat& src, Mat& dst, const Option& opt); + + void record_clone(const VkImageMat& src, Mat& dst, const Option& opt); + + void record_clone(const VkMat& src, VkMat& dst, const Option& opt); + + void record_clone(const VkImageMat& src, VkImageMat& dst, const Option& opt); + + void record_clone(const VkMat& src, VkImageMat& dst, const Option& opt); + + void record_clone(const VkImageMat& src, VkMat& dst, const Option& opt); + + void record_pipeline(const Pipeline* pipeline, const std::vector& bindings, const std::vector& constants, const VkMat& dispatcher); + + void record_pipeline(const Pipeline* pipeline, const std::vector& bindings, const std::vector& constants, const VkImageMat& dispatcher); + + void record_pipeline(const Pipeline* pipeline, const std::vector& buffer_bindings, const std::vector& image_bindings, const std::vector& constants, const VkMat& dispatcher); + void record_pipeline(const Pipeline* pipeline, const std::vector& buffer_bindings, const std::vector& image_bindings, const std::vector& constants, const VkImageMat& dispatcher); + void record_pipeline(const Pipeline* pipeline, const std::vector& buffer_bindings, const std::vector& image_bindings, const std::vector& constants, const Mat& dispatcher); + +#if NCNN_BENCHMARK + void record_write_timestamp(uint32_t query); +#endif // NCNN_BENCHMARK + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 + void record_import_android_hardware_buffer(const ImportAndroidHardwareBufferPipeline* pipeline, const VkImageMat& src, const VkMat& dst); +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + + int submit_and_wait(); + + int reset(); + + uint64_t pending_dispatch_total() const; + +#if NCNN_BENCHMARK + int create_query_pool(uint32_t query_count); + + int get_query_pool_results(uint32_t first_query, uint32_t query_count, std::vector& results); +#endif // NCNN_BENCHMARK + +protected: + const VulkanDevice* vkdev; + + void barrier_readwrite(const VkMat& binding); + void barrier_readwrite(const VkImageMat& binding); + void barrier_readonly(const VkImageMat& binding); + +private: + VkComputePrivate* const d; +}; + +class VkTransferPrivate; +class NCNN_EXPORT VkTransfer +{ +public: + explicit VkTransfer(const VulkanDevice* vkdev); + virtual ~VkTransfer(); + +public: + void record_upload(const Mat& src, VkMat& dst, const Option& opt, bool flatten = true); + + int submit_and_wait(); + + int reset(); + + uint64_t pending_upload_total() const; + +protected: + const VulkanDevice* vkdev; + +private: + VkTransferPrivate* const d; +}; + +} // namespace ncnn + +#endif // NCNN_VULKAN + +#endif // NCNN_COMMAND_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/cpu.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/cpu.h new file mode 100644 index 0000000..cbf4171 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/cpu.h @@ -0,0 +1,177 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_CPU_H +#define NCNN_CPU_H + +#include + +#if defined _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif +#if defined __ANDROID__ || defined __linux__ +#include // cpu_set_t +#endif + +#include "platform.h" + +namespace ncnn { + +class NCNN_EXPORT CpuSet +{ +public: + CpuSet(); + void enable(int cpu); + void disable(int cpu); + void disable_all(); + bool is_enabled(int cpu) const; + int num_enabled() const; + +public: +#if defined _WIN32 + ULONG_PTR mask; +#endif +#if defined __ANDROID__ || defined __linux__ + cpu_set_t cpu_set; +#endif +#if __APPLE__ + unsigned int policy; +#endif +}; + +// test optional cpu features +// edsp = armv7 edsp +NCNN_EXPORT int cpu_support_arm_edsp(); +// neon = armv7 neon or aarch64 asimd +NCNN_EXPORT int cpu_support_arm_neon(); +// vfpv4 = armv7 fp16 + fma +NCNN_EXPORT int cpu_support_arm_vfpv4(); +// asimdhp = aarch64 asimd half precision +NCNN_EXPORT int cpu_support_arm_asimdhp(); +// cpuid = aarch64 cpuid info +NCNN_EXPORT int cpu_support_arm_cpuid(); +// asimddp = aarch64 asimd dot product +NCNN_EXPORT int cpu_support_arm_asimddp(); +// asimdfhm = aarch64 asimd fhm +NCNN_EXPORT int cpu_support_arm_asimdfhm(); +// bf16 = aarch64 bf16 +NCNN_EXPORT int cpu_support_arm_bf16(); +// i8mm = aarch64 i8mm +NCNN_EXPORT int cpu_support_arm_i8mm(); +// sve = aarch64 sve +NCNN_EXPORT int cpu_support_arm_sve(); +// sve2 = aarch64 sve2 +NCNN_EXPORT int cpu_support_arm_sve2(); +// svebf16 = aarch64 svebf16 +NCNN_EXPORT int cpu_support_arm_svebf16(); +// svei8mm = aarch64 svei8mm +NCNN_EXPORT int cpu_support_arm_svei8mm(); +// svef32mm = aarch64 svef32mm +NCNN_EXPORT int cpu_support_arm_svef32mm(); + +// avx = x86 avx +NCNN_EXPORT int cpu_support_x86_avx(); +// fma = x86 fma +NCNN_EXPORT int cpu_support_x86_fma(); +// xop = x86 xop +NCNN_EXPORT int cpu_support_x86_xop(); +// f16c = x86 f16c +NCNN_EXPORT int cpu_support_x86_f16c(); +// avx2 = x86 avx2 + fma + f16c +NCNN_EXPORT int cpu_support_x86_avx2(); +// avx_vnni = x86 avx vnni +NCNN_EXPORT int cpu_support_x86_avx_vnni(); +// avx_vnni_int8 = x86 avx vnni int8 +NCNN_EXPORT int cpu_support_x86_avx_vnni_int8(); +// avx_vnni_int16 = x86 avx vnni int16 +NCNN_EXPORT int cpu_support_x86_avx_vnni_int16(); +// avx_ne_convert = x86 avx ne convert +NCNN_EXPORT int cpu_support_x86_avx_ne_convert(); +// avx512 = x86 avx512f + avx512cd + avx512bw + avx512dq + avx512vl +NCNN_EXPORT int cpu_support_x86_avx512(); +// avx512_vnni = x86 avx512 vnni +NCNN_EXPORT int cpu_support_x86_avx512_vnni(); +// avx512_bf16 = x86 avx512 bf16 +NCNN_EXPORT int cpu_support_x86_avx512_bf16(); +// avx512_fp16 = x86 avx512 fp16 +NCNN_EXPORT int cpu_support_x86_avx512_fp16(); + +// lsx = loongarch lsx +NCNN_EXPORT int cpu_support_loongarch_lsx(); +// lasx = loongarch lasx +NCNN_EXPORT int cpu_support_loongarch_lasx(); + +// msa = mips mas +NCNN_EXPORT int cpu_support_mips_msa(); +// mmi = loongson mmi +NCNN_EXPORT int cpu_support_loongson_mmi(); + +// v = riscv vector +NCNN_EXPORT int cpu_support_riscv_v(); +// zfh = riscv half-precision float +NCNN_EXPORT int cpu_support_riscv_zfh(); +// zvfh = riscv vector half-precision float +NCNN_EXPORT int cpu_support_riscv_zvfh(); +// xtheadvector = riscv xtheadvector +NCNN_EXPORT int cpu_support_riscv_xtheadvector(); +// vlenb = riscv vector length in bytes +NCNN_EXPORT int cpu_riscv_vlenb(); + +// cpu info +NCNN_EXPORT int get_cpu_count(); +NCNN_EXPORT int get_little_cpu_count(); +NCNN_EXPORT int get_big_cpu_count(); + +NCNN_EXPORT int get_physical_cpu_count(); +NCNN_EXPORT int get_physical_little_cpu_count(); +NCNN_EXPORT int get_physical_big_cpu_count(); + +// cpu l2 varies from 64k to 1M, but l3 can be zero +NCNN_EXPORT int get_cpu_level2_cache_size(); +NCNN_EXPORT int get_cpu_level3_cache_size(); + +// bind all threads on little clusters if powersave enabled +// affects HMP arch cpu like ARM big.LITTLE +// only implemented on android at the moment +// switching powersave is expensive and not thread-safe +// 0 = all cores enabled(default) +// 1 = only little clusters enabled +// 2 = only big clusters enabled +// return 0 if success for setter function +NCNN_EXPORT int get_cpu_powersave(); +NCNN_EXPORT int set_cpu_powersave(int powersave); + +// convenient wrapper +NCNN_EXPORT const CpuSet& get_cpu_thread_affinity_mask(int powersave); + +// set explicit thread affinity +NCNN_EXPORT int set_cpu_thread_affinity(const CpuSet& thread_affinity_mask); + +// runtime thread affinity info +NCNN_EXPORT int is_current_thread_running_on_a53_a55(); + +// misc function wrapper for openmp routines +NCNN_EXPORT int get_omp_num_threads(); +NCNN_EXPORT void set_omp_num_threads(int num_threads); + +NCNN_EXPORT int get_omp_dynamic(); +NCNN_EXPORT void set_omp_dynamic(int dynamic); + +NCNN_EXPORT int get_omp_thread_num(); + +NCNN_EXPORT int get_kmp_blocktime(); +NCNN_EXPORT void set_kmp_blocktime(int time_ms); + +// need to flush denormals on Intel Chipset. +// Other architectures such as ARM can be added as needed. +// 0 = DAZ OFF, FTZ OFF +// 1 = DAZ ON , FTZ OFF +// 2 = DAZ OFF, FTZ ON +// 3 = DAZ ON, FTZ ON +NCNN_EXPORT int get_flush_denormals(); +NCNN_EXPORT int set_flush_denormals(int flush_denormals); + +} // namespace ncnn + +#endif // NCNN_CPU_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/datareader.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/datareader.h new file mode 100644 index 0000000..0161d79 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/datareader.h @@ -0,0 +1,111 @@ +// Copyright 2019 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_DATAREADER_H +#define NCNN_DATAREADER_H + +#include "platform.h" +#if NCNN_STDIO +#include +#endif + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 +#include +#endif +#endif // NCNN_PLATFORM_API + +namespace ncnn { + +// data read wrapper +class NCNN_EXPORT DataReader +{ +public: + DataReader(); + virtual ~DataReader(); + +#if NCNN_STRING + // parse plain param text + // return 1 if scan success + virtual int scan(const char* format, void* p) const; +#endif // NCNN_STRING + + // read binary param and model data + // return bytes read + virtual size_t read(void* buf, size_t size) const; + + // get model data reference + // return bytes referenced + virtual size_t reference(size_t size, const void** buf) const; +}; + +#if NCNN_STDIO +class DataReaderFromStdioPrivate; +class NCNN_EXPORT DataReaderFromStdio : public DataReader +{ +public: + explicit DataReaderFromStdio(FILE* fp); + virtual ~DataReaderFromStdio(); + +#if NCNN_STRING + virtual int scan(const char* format, void* p) const; +#endif // NCNN_STRING + virtual size_t read(void* buf, size_t size) const; + +private: + DataReaderFromStdio(const DataReaderFromStdio&); + DataReaderFromStdio& operator=(const DataReaderFromStdio&); + +private: + DataReaderFromStdioPrivate* const d; +}; +#endif // NCNN_STDIO + +class DataReaderFromMemoryPrivate; +class NCNN_EXPORT DataReaderFromMemory : public DataReader +{ +public: + explicit DataReaderFromMemory(const unsigned char*& mem); + virtual ~DataReaderFromMemory(); + +#if NCNN_STRING + virtual int scan(const char* format, void* p) const; +#endif // NCNN_STRING + virtual size_t read(void* buf, size_t size) const; + virtual size_t reference(size_t size, const void** buf) const; + +private: + DataReaderFromMemory(const DataReaderFromMemory&); + DataReaderFromMemory& operator=(const DataReaderFromMemory&); + +private: + DataReaderFromMemoryPrivate* const d; +}; + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 +class DataReaderFromAndroidAssetPrivate; +class NCNN_EXPORT DataReaderFromAndroidAsset : public DataReader +{ +public: + explicit DataReaderFromAndroidAsset(AAsset* asset); + virtual ~DataReaderFromAndroidAsset(); + +#if NCNN_STRING + virtual int scan(const char* format, void* p) const; +#endif // NCNN_STRING + virtual size_t read(void* buf, size_t size) const; + +private: + DataReaderFromAndroidAsset(const DataReaderFromAndroidAsset&); + DataReaderFromAndroidAsset& operator=(const DataReaderFromAndroidAsset&); + +private: + DataReaderFromAndroidAssetPrivate* const d; +}; +#endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API + +} // namespace ncnn + +#endif // NCNN_DATAREADER_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/expression.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/expression.h new file mode 100644 index 0000000..194c739 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/expression.h @@ -0,0 +1,17 @@ +// Copyright 2025 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#include "mat.h" + +namespace ncnn { + +// count how many blobs are referenced inside expression +NCNN_EXPORT int count_expression_blobs(const std::string& expr); + +// resolve reshape shape from expression and input blobs +// resolve slice indices(starts, ends) from expression and input blobs +// see docs/developer-guide/expression.md +// return 0 if success +NCNN_EXPORT int eval_list_expression(const std::string& expr, const std::vector& blobs, std::vector& outlist); + +} // namespace ncnn diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/gpu.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/gpu.h new file mode 100644 index 0000000..aec8b03 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/gpu.h @@ -0,0 +1,585 @@ +// Copyright 2018 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_GPU_H +#define NCNN_GPU_H + +#include "platform.h" + +#if NCNN_VULKAN + +#include "mat.h" + +namespace ncnn { + +// instance + +// Create VkInstance and initialize some objects that need to be calculated by GPU +// Creates a VkInstance object, Checks the extended attributes supported by the Vulkan instance concerned, +// Initializes, and creates Vulkan validation layers (if ENABLE_VALIDATION_LAYER is enabled), +// Iterates over all supported physical devices, etc. +NCNN_EXPORT int create_gpu_instance(const char* driver_path = 0); + +// Get global VkInstance variable +// Must be called after create_gpu_instance() and before destroy_gpu_instance() +NCNN_EXPORT VkInstance get_gpu_instance(); + +// Destroy VkInstance object and free the memory of the associated object +// Usually called in the destructor of the main program exit +// The function will internally ensure that all vulkan devices are idle before proceeding with destruction. +NCNN_EXPORT void destroy_gpu_instance(); + +// vulkan core +extern PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers; +extern PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets; +extern PFN_vkAllocateMemory vkAllocateMemory; +extern PFN_vkBeginCommandBuffer vkBeginCommandBuffer; +extern PFN_vkBindBufferMemory vkBindBufferMemory; +extern PFN_vkBindImageMemory vkBindImageMemory; +extern PFN_vkCmdBeginQuery vkCmdBeginQuery; +extern PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets; +extern PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer; +extern PFN_vkCmdBindPipeline vkCmdBindPipeline; +extern PFN_vkCmdCopyBuffer vkCmdCopyBuffer; +extern PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage; +extern PFN_vkCmdCopyImage vkCmdCopyImage; +extern PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer; +extern PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults; +extern PFN_vkCmdDispatch vkCmdDispatch; +extern PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect; +extern PFN_vkCmdEndQuery vkCmdEndQuery; +extern PFN_vkCmdExecuteCommands vkCmdExecuteCommands; +extern PFN_vkCmdFillBuffer vkCmdFillBuffer; +extern PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier; +extern PFN_vkCmdPushConstants vkCmdPushConstants; +extern PFN_vkCmdResetQueryPool vkCmdResetQueryPool; +extern PFN_vkCmdResolveImage vkCmdResolveImage; +extern PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer; +extern PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp; +extern PFN_vkCreateBuffer vkCreateBuffer; +extern PFN_vkCreateBufferView vkCreateBufferView; +extern PFN_vkCreateCommandPool vkCreateCommandPool; +extern PFN_vkCreateComputePipelines vkCreateComputePipelines; +extern PFN_vkCreateDescriptorPool vkCreateDescriptorPool; +extern PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout; +extern PFN_vkCreateDevice vkCreateDevice; +extern PFN_vkCreateFence vkCreateFence; +extern PFN_vkCreateImage vkCreateImage; +extern PFN_vkCreateImageView vkCreateImageView; +extern PFN_vkCreatePipelineCache vkCreatePipelineCache; +extern PFN_vkCreatePipelineLayout vkCreatePipelineLayout; +extern PFN_vkCreateQueryPool vkCreateQueryPool; +extern PFN_vkCreateSampler vkCreateSampler; +extern PFN_vkCreateSemaphore vkCreateSemaphore; +extern PFN_vkCreateShaderModule vkCreateShaderModule; +extern PFN_vkDestroyBuffer vkDestroyBuffer; +extern PFN_vkDestroyBufferView vkDestroyBufferView; +extern PFN_vkDestroyCommandPool vkDestroyCommandPool; +extern PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool; +extern PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout; +extern PFN_vkDestroyDevice vkDestroyDevice; +extern PFN_vkDestroyFence vkDestroyFence; +extern PFN_vkDestroyImage vkDestroyImage; +extern PFN_vkDestroyImageView vkDestroyImageView; +extern PFN_vkDestroyInstance vkDestroyInstance; +extern PFN_vkDestroyPipeline vkDestroyPipeline; +extern PFN_vkDestroyPipelineCache vkDestroyPipelineCache; +extern PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout; +extern PFN_vkDestroyQueryPool vkDestroyQueryPool; +extern PFN_vkDestroySampler vkDestroySampler; +extern PFN_vkDestroySemaphore vkDestroySemaphore; +extern PFN_vkDestroyShaderModule vkDestroyShaderModule; +extern PFN_vkDeviceWaitIdle vkDeviceWaitIdle; +extern PFN_vkEndCommandBuffer vkEndCommandBuffer; +extern PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties; +extern PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties; +extern PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices; +extern PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges; +extern PFN_vkFreeCommandBuffers vkFreeCommandBuffers; +extern PFN_vkFreeDescriptorSets vkFreeDescriptorSets; +extern PFN_vkFreeMemory vkFreeMemory; +extern PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements; +extern PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment; +extern PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr; +extern PFN_vkGetDeviceQueue vkGetDeviceQueue; +extern PFN_vkGetFenceStatus vkGetFenceStatus; +extern PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements; +extern PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout; +extern PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures; +extern PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties; +extern PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties; +extern PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties; +extern PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; +extern PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties; +extern PFN_vkGetPipelineCacheData vkGetPipelineCacheData; +extern PFN_vkGetQueryPoolResults vkGetQueryPoolResults; +extern PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges; +extern PFN_vkMapMemory vkMapMemory; +extern PFN_vkMergePipelineCaches vkMergePipelineCaches; +extern PFN_vkQueueSubmit vkQueueSubmit; +extern PFN_vkQueueWaitIdle vkQueueWaitIdle; +extern PFN_vkResetCommandBuffer vkResetCommandBuffer; +extern PFN_vkResetCommandPool vkResetCommandPool; +extern PFN_vkResetDescriptorPool vkResetDescriptorPool; +extern PFN_vkResetFences vkResetFences; +extern PFN_vkUnmapMemory vkUnmapMemory; +extern PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets; +extern PFN_vkWaitForFences vkWaitForFences; + +// instance extension capability +extern int support_VK_KHR_external_memory_capabilities; +extern int support_VK_KHR_device_group_creation; +extern int support_VK_KHR_get_physical_device_properties2; +extern int support_VK_KHR_get_surface_capabilities2; +extern int support_VK_KHR_surface; +extern int support_VK_EXT_debug_utils; +extern int support_VK_EXT_validation_features; +extern int support_VK_EXT_validation_flags; +#if __ANDROID_API__ >= 26 +extern int support_VK_KHR_android_surface; +#endif // __ANDROID_API__ >= 26 + +// VK_KHR_cooperative_matrix +extern PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR; + +// VK_KHR_external_memory_capabilities +extern PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR vkGetPhysicalDeviceExternalBufferPropertiesKHR; + +// VK_KHR_get_physical_device_properties2 +extern PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; +extern PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR; +extern PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR; +extern PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2KHR; +extern PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR; +extern PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR; + +// VK_KHR_get_surface_capabilities2 +extern PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR; +extern PFN_vkGetPhysicalDeviceSurfaceFormats2KHR vkGetPhysicalDeviceSurfaceFormats2KHR; + +// VK_KHR_surface +extern PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR; +extern PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR; +extern PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR; +extern PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR; +extern PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR; + +#if __ANDROID_API__ >= 26 +// VK_KHR_android_surface +extern PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR; +#endif // __ANDROID_API__ >= 26 + +// VK_NV_cooperative_matrix +extern PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV vkGetPhysicalDeviceCooperativeMatrixPropertiesNV; + +// VK_NV_cooperative_matrix2 +extern PFN_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV; + +// VK_NV_cooperative_vector +extern PFN_vkGetPhysicalDeviceCooperativeVectorPropertiesNV vkGetPhysicalDeviceCooperativeVectorPropertiesNV; + +// get info +NCNN_EXPORT int get_gpu_count(); +NCNN_EXPORT int get_default_gpu_index(); + +class GpuInfoPrivate; +class NCNN_EXPORT GpuInfo +{ +public: + explicit GpuInfo(); + virtual ~GpuInfo(); + + int device_index() const; + + // vulkan physical device + VkPhysicalDevice physicalDevice() const; + VkPhysicalDevice physical_device() const; // api compatibility + + // features + const VkPhysicalDeviceFeatures& physicalDevicefeatures() const; + + // properties + const VkPhysicalDeviceProperties& physicalDeviceProperties() const; + + // memory properties + const VkPhysicalDeviceMemoryProperties& physicalDeviceMemoryProperties() const; + const VkPhysicalDeviceMemoryProperties& physical_device_memory_properties() const; // api compatibility + + // extension properties + const std::vector& deviceExtensionProperties() const; + + // info + uint32_t api_version() const; + uint32_t driver_version() const; + uint32_t vendor_id() const; + uint32_t device_id() const; + const char* device_name() const; + uint8_t* pipeline_cache_uuid() const; + + // driver properties + uint32_t driver_id() const; + const char* driver_name() const; + + // 0 = discrete gpu + // 1 = integrated gpu + // 2 = virtual gpu + // 3 = cpu + int type() const; + + // performance score roughly evaluated based on parameters such as device type, + // supported extensions, video memory size etc. + // high-end device scores over 75 + // low-end device scores below 10 + uint32_t rough_score() const; + + // hardware limit + uint32_t max_shared_memory_size() const; + uint32_t max_workgroup_count_x() const; + uint32_t max_workgroup_count_y() const; + uint32_t max_workgroup_count_z() const; + uint32_t max_workgroup_invocations() const; + uint32_t max_workgroup_size_x() const; + uint32_t max_workgroup_size_y() const; + uint32_t max_workgroup_size_z() const; + size_t memory_map_alignment() const; + size_t buffer_offset_alignment() const; + size_t non_coherent_atom_size() const; + size_t buffer_image_granularity() const; + uint32_t max_image_dimension_1d() const; + uint32_t max_image_dimension_2d() const; + uint32_t max_image_dimension_3d() const; + float timestamp_period() const; + + // runtime + uint32_t compute_queue_family_index() const; + uint32_t transfer_queue_family_index() const; + + uint32_t compute_queue_count() const; + uint32_t transfer_queue_count() const; + + // property + bool unified_compute_transfer_queue() const; + bool resizable_bar_enabled() const; + + // subgroup + uint32_t subgroup_size() const; + uint32_t min_subgroup_size() const; + uint32_t max_subgroup_size() const; + uint32_t max_compute_workgroup_subgroups() const; + bool support_subgroup_size_control() const; + bool support_compute_full_subgroups() const; + uint32_t support_subgroup_ops() const; + + // bug is not feature + bool bug_storage_buffer_no_l1() const; + bool bug_corrupted_online_pipeline_cache() const; + bool bug_buffer_image_load_zero() const; + + // but sometimes bug is a feature + bool bug_implicit_fp16_arithmetic() const; + + // fp16 and int8 feature + bool support_fp16_packed() const; + bool support_fp16_storage() const; + bool support_fp16_uniform() const; + bool support_fp16_arithmetic() const; + bool support_int8_packed() const; + bool support_int8_storage() const; + bool support_int8_uniform() const; + bool support_int8_arithmetic() const; + + // bf16 feature + bool support_bf16_packed() const; + bool support_bf16_storage() const; // bf16s implies bf16u + + // r16f and r8s format in storage image + bool support_fp16_image() const; + bool support_int8_image() const; + + // shader float controls2 + bool support_fp_fast_math() const; + + // ycbcr conversion feature + bool support_ycbcr_conversion() const; + + // cooperative matrix feature + bool support_cooperative_matrix() const; + bool support_cooperative_matrix_8_8_16() const; + bool support_cooperative_matrix_16_8_8() const; + bool support_cooperative_matrix_16_8_16() const; + bool support_cooperative_matrix_16_16_16() const; + + // bf16 cooperative matrix feature + bool support_bf16_cooperative_matrix() const; + + // extension capability + int support_VK_KHR_8bit_storage() const; + int support_VK_KHR_16bit_storage() const; + int support_VK_KHR_bind_memory2() const; + int support_VK_KHR_buffer_device_address() const; + int support_VK_KHR_create_renderpass2() const; + int support_VK_KHR_cooperative_matrix() const; + int support_VK_KHR_dedicated_allocation() const; + int support_VK_KHR_descriptor_update_template() const; + int support_VK_KHR_device_group() const; + int support_VK_KHR_driver_properties() const; + int support_VK_KHR_external_memory() const; + int support_VK_KHR_get_memory_requirements2() const; + int support_VK_KHR_maintenance1() const; + int support_VK_KHR_maintenance2() const; + int support_VK_KHR_maintenance3() const; + int support_VK_KHR_multiview() const; + int support_VK_KHR_portability_subset() const; + int support_VK_KHR_push_descriptor() const; + int support_VK_KHR_robustness2() const; + int support_VK_KHR_sampler_ycbcr_conversion() const; + int support_VK_KHR_shader_bfloat16() const; + int support_VK_KHR_shader_float16_int8() const; + int support_VK_KHR_shader_float_controls() const; + int support_VK_KHR_shader_float_controls2() const; + int support_VK_KHR_shader_integer_dot_product() const; + int support_VK_KHR_shader_non_semantic_info() const; + int support_VK_KHR_shader_subgroup_extended_types() const; + int support_VK_KHR_shader_subgroup_rotate() const; + int support_VK_KHR_storage_buffer_storage_class() const; + int support_VK_KHR_swapchain() const; + int support_VK_KHR_vulkan_memory_model() const; + int support_VK_KHR_zero_initialize_workgroup_memory() const; + int support_VK_EXT_buffer_device_address() const; + int support_VK_EXT_descriptor_indexing() const; + int support_VK_EXT_external_memory_host() const; + int support_VK_EXT_memory_budget() const; + int support_VK_EXT_memory_priority() const; + int support_VK_EXT_queue_family_foreign() const; + int support_VK_EXT_robustness2() const; + int support_VK_EXT_shader_atomic_float() const; + int support_VK_EXT_shader_atomic_float2() const; + int support_VK_EXT_shader_float8() const; + int support_VK_EXT_subgroup_size_control() const; + int support_VK_AMD_device_coherent_memory() const; +#if __ANDROID_API__ >= 26 + int support_VK_ANDROID_external_memory_android_hardware_buffer() const; +#endif // __ANDROID_API__ >= 26 + int support_VK_NV_cooperative_matrix() const; + int support_VK_NV_cooperative_matrix2() const; + int support_VK_NV_cooperative_vector() const; + + // extension features + const void* queryExtensionFeatures() const; + const VkPhysicalDevice8BitStorageFeaturesKHR& query8BitStorageFeatures() const; + const VkPhysicalDevice16BitStorageFeaturesKHR& query16BitStorageFeatures() const; + const VkPhysicalDeviceFloat16Int8FeaturesKHR& queryFloat16Int8Features() const; + const VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR& querySamplerYcbcrConversionFeatures() const; + const VkPhysicalDeviceCooperativeMatrixFeaturesKHR& queryCooperativeMatrixFeatures() const; + const VkPhysicalDeviceCooperativeMatrixFeaturesNV& queryCooperativeMatrixFeaturesNV() const; + const VkPhysicalDeviceCooperativeMatrix2FeaturesNV& queryCooperativeMatrix2FeaturesNV() const; + const VkPhysicalDeviceCooperativeVectorFeaturesNV& queryCooperativeVectorFeaturesNV() const; + const VkPhysicalDeviceRobustness2FeaturesKHR& queryRobustness2Features() const; + const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT& querySubgroupSizeControlFeatures() const; + const VkPhysicalDeviceShaderBfloat16FeaturesKHR& queryShaderBfloat16Features() const; + const VkPhysicalDeviceShaderFloat8FeaturesEXT& queryShaderFloat8Features() const; + const VkPhysicalDeviceShaderFloatControls2FeaturesKHR& queryShaderFloatControls2Features() const; + const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR& queryShaderIntegerDotProductFeatures() const; + const VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR& queryShaderSubgroupRotateFeatures() const; + const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT& queryShaderAtomicFloatFeatures() const; + const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT& queryShaderAtomicFloat2Features() const; + const VkPhysicalDeviceVulkanMemoryModelFeaturesKHR& queryVulkanMemoryModelFeatures() const; + + // extension properties + const void* queryExtensionProperties() const; + const VkPhysicalDeviceCooperativeMatrix2PropertiesNV& queryCooperativeMatrix2PropertiesNV() const; + const VkPhysicalDeviceCooperativeVectorPropertiesNV& queryCooperativeVectorPropertiesNV() const; + const VkPhysicalDeviceDriverPropertiesKHR& queryDriverProperties() const; + const VkPhysicalDeviceFloatControlsPropertiesKHR& queryFloatControlsProperties() const; + const VkPhysicalDeviceRobustness2PropertiesKHR& queryRobustness2Properties() const; + const VkPhysicalDeviceShaderIntegerDotProductProperties& queryShaderIntegerDotProductProperties() const; + const VkPhysicalDeviceSubgroupProperties& querySubgroupProperties() const; + const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT& querySubgroupSizeControlProperties() const; + const VkPhysicalDeviceExternalMemoryHostPropertiesEXT& queryExternalMemoryHostProperties() const; + + // extension sub properties + const std::vector& queryCooperativeMatrixSubProperties() const; + const std::vector& queryCooperativeMatrixSubPropertiesNV() const; + const std::vector& queryCooperativeMatrixFlexibleDimensionsSubPropertiesNV() const; + const std::vector& queryCooperativeVectorSubPropertiesNV() const; + + // some utility functions + void get_optimal_cooperative_matrix_mnk(int M, int N, int K, VkComponentTypeKHR type, VkComponentTypeKHR acctype, VkScopeKHR scope, int& coopmat_M, int& coopmat_N, int& coopmat_K, int& coopmat_subgroup_size) const; + +private: + GpuInfo(const GpuInfo&); + GpuInfo& operator=(const GpuInfo&); + +private: + friend int create_gpu_instance(const char* driver_path); + GpuInfoPrivate* const d; +}; + +NCNN_EXPORT const GpuInfo& get_gpu_info(int device_index = get_default_gpu_index()); + +class VkAllocator; +class VkCompute; +class Option; +class PipelineCache; +class VulkanDevicePrivate; +class NCNN_EXPORT VulkanDevice +{ +public: + VulkanDevice(int device_index = get_default_gpu_index()); + ~VulkanDevice(); + + const GpuInfo& info; + + VkDevice vkdevice() const; + bool is_valid() const; + + VkShaderModule compile_shader_module(const uint32_t* spv_data, size_t spv_data_size) const; + + // with fixed workgroup size + VkShaderModule compile_shader_module(const uint32_t* spv_data, size_t spv_data_size, uint32_t local_size_x, uint32_t local_size_y, uint32_t local_size_z) const; + + // helper for creating pipeline + int create_descriptorset_layout(int binding_count, const int* binding_types, VkDescriptorSetLayout* descriptorset_layout) const; + int create_pipeline_layout(int push_constant_count, VkDescriptorSetLayout descriptorset_layout, VkPipelineLayout* pipeline_layout) const; + int create_pipeline(VkShaderModule shader_module, VkPipelineLayout pipeline_layout, const std::vector& specializations, uint32_t subgroup_size, VkPipeline* pipeline) const; + int create_pipeline(VkShaderModule shader_module, VkPipelineLayout pipeline_layout, const std::vector& specializations, uint32_t subgroup_size, VkPipelineCache pipeline_cache, VkPipeline* pipeline) const; + int create_descriptor_update_template(int binding_count, const int* binding_types, VkDescriptorSetLayout descriptorset_layout, VkPipelineLayout pipeline_layout, VkDescriptorUpdateTemplateKHR* descriptor_update_template) const; + + uint32_t find_memory_index(uint32_t memory_type_bits, VkFlags required, VkFlags preferred, VkFlags preferred_not) const; + bool is_mappable(uint32_t memory_type_index) const; + bool is_coherent(uint32_t memory_type_index) const; + bool is_device_local(uint32_t memory_type_index) const; + + VkQueue acquire_queue(uint32_t queue_family_index) const; + void reclaim_queue(uint32_t queue_family_index, VkQueue queue) const; + + // allocator on this device + VkAllocator* acquire_blob_allocator() const; + void reclaim_blob_allocator(VkAllocator* allocator) const; + + VkAllocator* acquire_staging_allocator() const; + void reclaim_staging_allocator(VkAllocator* allocator) const; + + // immutable sampler for texelfetch + const VkSampler* immutable_texelfetch_sampler() const; + + // dummy buffer image + VkMat get_dummy_buffer() const; + VkImageMat get_dummy_image() const; + VkImageMat get_dummy_image_readonly() const; + + // pipeline cache on this device + const PipelineCache* get_pipeline_cache() const; + + // test image allocation + bool shape_support_image_storage(const Mat& shape) const; + + // current gpu heap memory budget in MB + uint32_t get_heap_budget() const; + + // utility operator + void convert_packing(const VkMat& src, VkMat& dst, int dst_elempack, VkCompute& cmd, const Option& opt) const; + // cast_type_to 0=auto(same as src) 1=fp32 2=fp16 3=int32 4=int8 5=bf16 + void convert_packing(const VkMat& src, VkMat& dst, int dst_elempack, int cast_type_to, VkCompute& cmd, const Option& opt) const; + + // VK_KHR_bind_memory2 + PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR; + PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR; + + // VK_KHR_buffer_device_address + PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR; + PFN_vkGetBufferOpaqueCaptureAddressKHR vkGetBufferOpaqueCaptureAddressKHR; + PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR vkGetDeviceMemoryOpaqueCaptureAddressKHR; + + // VK_KHR_descriptor_update_template + PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR; + PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR; + PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR; + + // VK_KHR_get_memory_requirements2 + PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR; + PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR; + + // VK_KHR_maintenance1 + PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR; + + // VK_KHR_maintenance3 + PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR; + + // VK_KHR_push_descriptor + PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR; + PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR; + + // VK_KHR_sampler_ycbcr_conversion + PFN_vkCreateSamplerYcbcrConversionKHR vkCreateSamplerYcbcrConversionKHR; + PFN_vkDestroySamplerYcbcrConversionKHR vkDestroySamplerYcbcrConversionKHR; + + // VK_KHR_swapchain + PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR; + PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR; + PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR; + PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR; + PFN_vkQueuePresentKHR vkQueuePresentKHR; + + // VK_EXT_buffer_device_address + PFN_vkGetBufferDeviceAddressEXT vkGetBufferDeviceAddressEXT; + + // VK_EXT_external_memory_host + PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT; + +#if __ANDROID_API__ >= 26 + // VK_ANDROID_external_memory_android_hardware_buffer + PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID; + PFN_vkGetMemoryAndroidHardwareBufferANDROID vkGetMemoryAndroidHardwareBufferANDROID; +#endif // __ANDROID_API__ >= 26 + + // VK_NV_cooperative_vector + PFN_vkCmdConvertCooperativeVectorMatrixNV vkCmdConvertCooperativeVectorMatrixNV; + PFN_vkConvertCooperativeVectorMatrixNV vkConvertCooperativeVectorMatrixNV; + +protected: + // device extension + int init_device_extension(); + +private: + VulkanDevice(const VulkanDevice&); + VulkanDevice& operator=(const VulkanDevice&); + +private: + VulkanDevicePrivate* const d; +}; + +NCNN_EXPORT VulkanDevice* get_gpu_device(int device_index = get_default_gpu_index()); + +// online spirv compilation +NCNN_EXPORT int compile_spirv_module(const char* comp_string, const Option& opt, std::vector& spirv); +NCNN_EXPORT int compile_spirv_module(const char* comp_data, int comp_data_size, const Option& opt, std::vector& spirv); +NCNN_EXPORT int compile_spirv_module(int shader_type_index, const Option& opt, std::vector& spirv); + +// info from spirv +class NCNN_EXPORT ShaderInfo +{ +public: + int specialization_count; + int binding_count; + int push_constant_count; + + // 0 = null + // 1 = storage buffer + // 2 = storage image + // 3 = combined image sampler + int binding_types[16]; // 16 is large enough I think ... + + int reserved_0; + int reserved_1; + int reserved_2; + int reserved_3; +}; + +NCNN_EXPORT int resolve_shader_info(const uint32_t* spv_data, size_t spv_data_size, ShaderInfo& shader_info); + +} // namespace ncnn + +#endif // NCNN_VULKAN + +#endif // NCNN_GPU_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/layer.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/layer.h new file mode 100644 index 0000000..9fa45d7 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/layer.h @@ -0,0 +1,212 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_LAYER_H +#define NCNN_LAYER_H + +#include "mat.h" +#include "modelbin.h" +#include "option.h" +#include "paramdict.h" +#include "platform.h" + +#if NCNN_VULKAN +#include "command.h" +#include "pipeline.h" +#endif // NCNN_VULKAN + +namespace ncnn { + +class NCNN_EXPORT Layer +{ +public: + // empty + Layer(); + // virtual destructor + virtual ~Layer(); + + // load layer specific parameter from parsed dict + // return 0 if success + virtual int load_param(const ParamDict& pd); + + // load layer specific weight data from model binary + // return 0 if success + virtual int load_model(const ModelBin& mb); + + // layer implementation specific setup + // return 0 if success + virtual int create_pipeline(const Option& opt); + + // layer implementation specific clean + // return 0 if success + virtual int destroy_pipeline(const Option& opt); + +public: + // one input and one output blob + bool one_blob_only; + + // support inplace inference + bool support_inplace; + + // support vulkan compute + bool support_vulkan; + + // accept input blob with packed storage + bool support_packing; + + // accept bf16 + bool support_bf16_storage; + + // accept fp16 + bool support_fp16_storage; + + // accept int8 + bool support_int8_storage; + + // shader tensor storage + bool support_tensor_storage; + + // vulkan accept input blob with packed storage + bool support_vulkan_packing; + + // accept input blob with any elempack + bool support_any_packing; + + // vulkan accept input blob with any elempack + bool support_vulkan_any_packing; + + bool support_reserved_1; + bool support_reserved_2; + bool support_reserved_3; + bool support_reserved_4; + bool support_reserved_5; + bool support_reserved_6; + bool support_reserved_7; + bool support_reserved_8; + bool support_reserved_9; + + // feature disabled set + int featmask; + +public: + // implement inference + // return 0 if success + virtual int forward(const std::vector& bottom_blobs, std::vector& top_blobs, const Option& opt) const; + virtual int forward(const Mat& bottom_blob, Mat& top_blob, const Option& opt) const; + + // implement inplace inference + // return 0 if success + virtual int forward_inplace(std::vector& bottom_top_blobs, const Option& opt) const; + virtual int forward_inplace(Mat& bottom_top_blob, const Option& opt) const; + +#if NCNN_VULKAN +public: + // upload weight blob from host to device + virtual int upload_model(VkTransfer& cmd, const Option& opt); + +public: + // implement inference + // return 0 if success + virtual int forward(const std::vector& bottom_blobs, std::vector& top_blobs, VkCompute& cmd, const Option& opt) const; + virtual int forward(const VkMat& bottom_blob, VkMat& top_blob, VkCompute& cmd, const Option& opt) const; + + // implement inplace inference + // return 0 if success + virtual int forward_inplace(std::vector& bottom_top_blobs, VkCompute& cmd, const Option& opt) const; + virtual int forward_inplace(VkMat& bottom_top_blob, VkCompute& cmd, const Option& opt) const; + +public: + // assigned immediately after creating this layer + const VulkanDevice* vkdev; +#endif // NCNN_VULKAN + +public: + // custom user data + void* userdata; + // layer type index + int typeindex; +#if NCNN_STRING + // layer type name + std::string type; + // layer name + std::string name; +#endif // NCNN_STRING + // blob index which this layer needs as input + std::vector bottoms; + // blob index which this layer produces as output + std::vector tops; + // shape hint + std::vector bottom_shapes; + std::vector top_shapes; +}; + +// layer factory function +typedef Layer* (*layer_creator_func)(void*); +typedef void (*layer_destroyer_func)(Layer*, void*); + +struct layer_registry_entry +{ +#if NCNN_STRING + // layer type name + const char* name; +#endif // NCNN_STRING + // layer factory entry + layer_creator_func creator; +}; + +struct custom_layer_registry_entry +{ +#if NCNN_STRING + // layer type name + const char* name; +#endif // NCNN_STRING + // layer factory entry + layer_creator_func creator; + layer_destroyer_func destroyer; + void* userdata; +}; + +struct overwrite_builtin_layer_registry_entry +{ + // layer type index + int typeindex; + // layer factory entry + layer_creator_func creator; + layer_destroyer_func destroyer; + void* userdata; +}; + +#if NCNN_STRING +// get layer type from type name +NCNN_EXPORT int layer_to_index(const char* type); +// create layer from type name +NCNN_EXPORT Layer* create_layer(const char* type); +NCNN_EXPORT Layer* create_layer_naive(const char* type); +NCNN_EXPORT Layer* create_layer_cpu(const char* type); +#if NCNN_VULKAN +NCNN_EXPORT Layer* create_layer_vulkan(const char* type); +#endif // NCNN_VULKAN +#endif // NCNN_STRING +// create layer from layer type +NCNN_EXPORT Layer* create_layer(int index); +NCNN_EXPORT Layer* create_layer_naive(int index); +NCNN_EXPORT Layer* create_layer_cpu(int index); +#if NCNN_VULKAN +NCNN_EXPORT Layer* create_layer_vulkan(int index); +#endif // NCNN_VULKAN + +#define DEFINE_LAYER_CREATOR(name) \ + ::ncnn::Layer* name##_layer_creator(void* /*userdata*/) \ + { \ + return new name; \ + } + +#define DEFINE_LAYER_DESTROYER(name) \ + void name##_layer_destroyer(::ncnn::Layer* layer, void* /*userdata*/) \ + { \ + delete layer; \ + } + +} // namespace ncnn + +#endif // NCNN_LAYER_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_shader_type.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_shader_type.h new file mode 100644 index 0000000..6e648eb --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_shader_type.h @@ -0,0 +1,18 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_LAYER_SHADER_TYPE_H +#define NCNN_LAYER_SHADER_TYPE_H + +namespace ncnn { + +namespace LayerShaderType { +enum LayerShaderType +{ +#include "layer_shader_type_enum.h" +}; +} // namespace LayerShaderType + +} // namespace ncnn + +#endif // NCNN_LAYER_SHADER_TYPE_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_shader_type_enum.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_shader_type_enum.h new file mode 100644 index 0000000..7b389d8 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_shader_type_enum.h @@ -0,0 +1,253 @@ +// Layer Shader Enum header +// +// This file is auto-generated by cmake, don't edit it. + +absval = 0, +batchnorm = 1, +batchnorm_pack4 = 2, +concat = 3, +concat_pack4 = 4, +concat_pack4to1 = 5, +convolution_1x1s1d1_cm = 6, +convolution_3x3s1d1_winograd23_transform_input = 7, +convolution_3x3s1d1_winograd23_transform_output = 8, +convolution_3x3s1d1_winograd43_transform_input = 9, +convolution_3x3s1d1_winograd43_transform_output = 10, +convolution_3x3s1d1_winograd_gemm = 11, +convolution_gemm_cm = 12, +convolution_pack1to4_3x3s1d1_winograd_gemm = 13, +convolution_pack4_3x3s1d1_winograd23_transform_input = 14, +convolution_pack4_3x3s1d1_winograd23_transform_output = 15, +convolution_pack4_3x3s1d1_winograd43_transform_input = 16, +convolution_pack4_3x3s1d1_winograd43_transform_output = 17, +convolution_pack4_3x3s1d1_winograd_gemm = 18, +convolution_pack4to1_3x3s1d1_winograd_gemm = 19, +convolution_packed = 20, +convolution_packed_1x1s1d1 = 21, +convolution_packed_gemm = 22, +convolution_winograd_gemm_cm = 23, +crop = 24, +crop_pack1to4 = 25, +crop_pack4 = 26, +crop_pack4to1 = 27, +deconvolution_col2im = 28, +deconvolution_gemm_cm = 29, +deconvolution_gemm_packed = 30, +deconvolution_pack4_col2im = 31, +deconvolution_packed = 32, +dropout = 33, +eltwise = 34, +elu = 35, +flatten = 36, +flatten_pack1to4 = 37, +flatten_pack4 = 38, +innerproduct = 39, +innerproduct_gemm = 40, +innerproduct_gemm_wp1to4 = 41, +innerproduct_gemm_wp4 = 42, +innerproduct_gemm_wp4to1 = 43, +innerproduct_pack1to4 = 44, +innerproduct_pack4 = 45, +innerproduct_pack4to1 = 46, +innerproduct_reduce_sum8 = 47, +innerproduct_reduce_sum8_pack4 = 48, +innerproduct_sum8 = 49, +innerproduct_sum8_pack1to4 = 50, +innerproduct_sum8_pack4 = 51, +innerproduct_sum8_pack4to1 = 52, +lrn_norm = 53, +lrn_norm_across_channel_pack4 = 54, +lrn_norm_within_channel_pack4 = 55, +lrn_square_pad = 56, +lrn_square_pad_across_channel_pack4 = 57, +lrn_square_pad_within_channel_pack4 = 58, +pooling = 59, +pooling_adaptive = 60, +pooling_adaptive_pack4 = 61, +pooling_global_reduce_max = 62, +pooling_global_reduce_max_first = 63, +pooling_global_reduce_max_first_pack4 = 64, +pooling_global_reduce_max_last = 65, +pooling_global_reduce_max_last_pack4 = 66, +pooling_global_reduce_max_pack4 = 67, +pooling_global_reduce_sum = 68, +pooling_global_reduce_sum_first = 69, +pooling_global_reduce_sum_first_pack4 = 70, +pooling_global_reduce_sum_last = 71, +pooling_global_reduce_sum_last_pack4 = 72, +pooling_global_reduce_sum_pack4 = 73, +pooling_pack4 = 74, +prelu = 75, +prelu_pack4 = 76, +reduction = 77, +relu = 78, +reshape = 79, +reshape_pack1to4 = 80, +reshape_pack4 = 81, +reshape_pack4to1 = 82, +scale = 83, +scale_pack4 = 84, +sigmoid = 85, +slice = 86, +slice_pack1to4 = 87, +slice_pack4 = 88, +softmax_div_sum = 89, +softmax_div_sum_pack4 = 90, +softmax_exp_sub_max = 91, +softmax_exp_sub_max_pack4 = 92, +softmax_reduce_max = 93, +softmax_reduce_max_pack4 = 94, +softmax_reduce_sum = 95, +softmax_reduce_sum_pack4 = 96, +tanh = 97, +binaryop = 98, +binaryop_broadcast = 99, +binaryop_broadcast_pack1to4 = 100, +binaryop_broadcast_pack4 = 101, +binaryop_pack4 = 102, +unaryop = 103, +convolutiondepthwise = 104, +convolutiondepthwise_group = 105, +convolutiondepthwise_group_pack1to4 = 106, +convolutiondepthwise_group_pack4 = 107, +convolutiondepthwise_group_pack4to1 = 108, +convolutiondepthwise_pack4 = 109, +padding = 110, +padding_3d = 111, +padding_3d_pack4 = 112, +padding_pack1to4 = 113, +padding_pack4 = 114, +padding_pack4to1 = 115, +normalize_coeffs = 116, +normalize_coeffs_pack4 = 117, +normalize_norm = 118, +normalize_norm_pack4 = 119, +normalize_reduce_sum4_fp16_to_fp32 = 120, +normalize_reduce_sum4_fp16_to_fp32_pack4 = 121, +normalize_reduce_sum4_fp32 = 122, +normalize_reduce_sum4_fp32_pack4 = 123, +permute = 124, +permute_pack1to4 = 125, +permute_pack4 = 126, +permute_pack4to1 = 127, +priorbox = 128, +priorbox_mxnet = 129, +interp = 130, +interp_bicubic = 131, +interp_bicubic_coeffs = 132, +interp_bicubic_pack4 = 133, +interp_pack4 = 134, +deconvolutiondepthwise = 135, +deconvolutiondepthwise_group = 136, +deconvolutiondepthwise_group_pack1to4 = 137, +deconvolutiondepthwise_group_pack4 = 138, +deconvolutiondepthwise_group_pack4to1 = 139, +deconvolutiondepthwise_pack4 = 140, +shufflechannel = 141, +shufflechannel_pack4 = 142, +instancenorm_coeffs = 143, +instancenorm_coeffs_pack4 = 144, +instancenorm_norm = 145, +instancenorm_norm_pack4 = 146, +instancenorm_reduce_mean = 147, +instancenorm_reduce_mean_pack4 = 148, +instancenorm_reduce_sum4_fp16_to_fp32 = 149, +instancenorm_reduce_sum4_fp16_to_fp32_pack4 = 150, +instancenorm_reduce_sum4_fp32 = 151, +instancenorm_reduce_sum4_fp32_pack4 = 152, +instancenorm_sub_mean_square = 153, +instancenorm_sub_mean_square_pack4 = 154, +clip = 155, +reorg = 156, +reorg_pack1to4 = 157, +reorg_pack4 = 158, +quantize = 159, +quantize_pack4 = 160, +dequantize = 161, +dequantize_pack4 = 162, +packing = 163, +packing_int8 = 164, +packing_pack1to4 = 165, +packing_pack1to4_int8 = 166, +packing_pack4to1 = 167, +packing_pack4to1_int8 = 168, +requantize = 169, +requantize_pack4 = 170, +cast_fp16_to_fp32 = 171, +cast_fp16_to_fp32_pack4 = 172, +cast_fp32_to_fp16 = 173, +cast_fp32_to_fp16_pack4 = 174, +hardsigmoid = 175, +selu = 176, +hardswish = 177, +pixelshuffle = 178, +pixelshuffle_pack4 = 179, +pixelshuffle_pack4to1 = 180, +deepcopy = 181, +deepcopy_pack4 = 182, +mish = 183, +swish = 184, +gemm = 185, +gemm_cm = 186, +gemm_sg = 187, +groupnorm_coeffs = 188, +groupnorm_coeffs_pack4 = 189, +groupnorm_norm = 190, +groupnorm_norm_pack4 = 191, +groupnorm_reduce_mean = 192, +groupnorm_reduce_mean_pack4 = 193, +groupnorm_reduce_sum4_fp16_to_fp32 = 194, +groupnorm_reduce_sum4_fp16_to_fp32_pack4 = 195, +groupnorm_reduce_sum4_fp32 = 196, +groupnorm_reduce_sum4_fp32_pack4 = 197, +groupnorm_sub_mean_square = 198, +groupnorm_sub_mean_square_pack4 = 199, +layernorm_coeffs = 200, +layernorm_coeffs_pack4 = 201, +layernorm_norm = 202, +layernorm_norm_pack4 = 203, +layernorm_reduce_mean = 204, +layernorm_reduce_mean_pack4 = 205, +layernorm_reduce_sum4_fp16_to_fp32 = 206, +layernorm_reduce_sum4_fp16_to_fp32_pack4 = 207, +layernorm_reduce_sum4_fp32 = 208, +layernorm_reduce_sum4_fp32_pack4 = 209, +layernorm_sub_mean_square = 210, +layernorm_sub_mean_square_pack4 = 211, +softplus = 212, +multiheadattention_qk_cross = 213, +multiheadattention_qk_cross_pack1to4 = 214, +multiheadattention_qk_cross_pack4 = 215, +multiheadattention_qk_cross_pack4to1 = 216, +multiheadattention_qkv_cross = 217, +multiheadattention_qkv_cross_pack1to4 = 218, +multiheadattention_qkv_cross_pack4 = 219, +multiheadattention_qkv_cross_pack4to1 = 220, +gelu = 221, +convolution1d_1x1s1d1_cm = 222, +convolution1d_gemm_cm = 223, +convolution1d_packed = 224, +convolution1d_packed_1x1s1d1 = 225, +convolution1d_packed_gemm = 226, +unfold_im2col = 227, +unfold_im2col_pack1to4 = 228, +unfold_im2col_pack4 = 229, +unfold_im2col_pack4to1 = 230, +erf = 231, +celu = 232, +shrink = 233, +rmsnorm_coeffs = 234, +rmsnorm_coeffs_pack4 = 235, +rmsnorm_norm = 236, +rmsnorm_norm_pack4 = 237, +rmsnorm_square = 238, +rmsnorm_square_pack4 = 239, +sdpa_cross = 240, +sdpa_cross_cm = 241, +sdpa_fa = 242, +sdpa_fa_cm = 243, +rotaryembed = 244, +rotaryembed_pack4 = 245, +convert_ycbcr = 246, +vulkan_activation = 247, + diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_type.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_type.h new file mode 100644 index 0000000..d65c591 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_type.h @@ -0,0 +1,19 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_LAYER_TYPE_H +#define NCNN_LAYER_TYPE_H + +namespace ncnn { + +namespace LayerType { +enum LayerType +{ +#include "layer_type_enum.h" + CustomBit = (1 << 8), +}; +} // namespace LayerType + +} // namespace ncnn + +#endif // NCNN_LAYER_TYPE_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_type_enum.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_type_enum.h new file mode 100644 index 0000000..5e7a446 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/layer_type_enum.h @@ -0,0 +1,115 @@ +// Layer Type Enum header +// +// This file is auto-generated by cmake, don't edit it. + +AbsVal = 0, +ArgMax = 1, +BatchNorm = 2, +Bias = 3, +BNLL = 4, +Concat = 5, +Convolution = 6, +Crop = 7, +Deconvolution = 8, +Dropout = 9, +Eltwise = 10, +ELU = 11, +Embed = 12, +Exp = 13, +Flatten = 14, +InnerProduct = 15, +Input = 16, +Log = 17, +LRN = 18, +MemoryData = 19, +MVN = 20, +Pooling = 21, +Power = 22, +PReLU = 23, +Proposal = 24, +Reduction = 25, +ReLU = 26, +Reshape = 27, +ROIPooling = 28, +Scale = 29, +Sigmoid = 30, +Slice = 31, +Softmax = 32, +Split = 33, +SPP = 34, +TanH = 35, +Threshold = 36, +Tile = 37, +RNN = 38, +LSTM = 39, +BinaryOp = 40, +UnaryOp = 41, +ConvolutionDepthWise = 42, +Padding = 43, +Squeeze = 44, +ExpandDims = 45, +Normalize = 46, +Permute = 47, +PriorBox = 48, +DetectionOutput = 49, +Interp = 50, +DeconvolutionDepthWise = 51, +ShuffleChannel = 52, +InstanceNorm = 53, +Clip = 54, +Reorg = 55, +YoloDetectionOutput = 56, +Quantize = 57, +Dequantize = 58, +Yolov3DetectionOutput = 59, +PSROIPooling = 60, +ROIAlign = 61, +Packing = 62, +Requantize = 63, +Cast = 64, +HardSigmoid = 65, +SELU = 66, +HardSwish = 67, +Noop = 68, +PixelShuffle = 69, +DeepCopy = 70, +Mish = 71, +StatisticsPooling = 72, +Swish = 73, +Gemm = 74, +GroupNorm = 75, +LayerNorm = 76, +Softplus = 77, +GRU = 78, +MultiHeadAttention = 79, +GELU = 80, +Convolution1D = 81, +Pooling1D = 82, +ConvolutionDepthWise1D = 83, +Convolution3D = 84, +ConvolutionDepthWise3D = 85, +Pooling3D = 86, +MatMul = 87, +Deconvolution1D = 88, +DeconvolutionDepthWise1D = 89, +Deconvolution3D = 90, +DeconvolutionDepthWise3D = 91, +Einsum = 92, +DeformableConv2D = 93, +GLU = 94, +Fold = 95, +Unfold = 96, +GridSample = 97, +CumulativeSum = 98, +CopyTo = 99, +Erf = 100, +Diag = 101, +CELU = 102, +Shrink = 103, +RMSNorm = 104, +Spectrogram = 105, +InverseSpectrogram = 106, +Flip = 107, +SDPA = 108, +RotaryEmbed = 109, + diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/mat.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/mat.h new file mode 100644 index 0000000..9e353aa --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/mat.h @@ -0,0 +1,1868 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_MAT_H +#define NCNN_MAT_H + +#include +#include +#if __ARM_NEON +#include +#endif +#if __SSE2__ +#include +#if __AVX__ +#include +#endif +#endif +#if __mips_msa +#include +#endif +#if __loongarch_sx +#include +#endif +#if __riscv_vector +#include +#include "cpu.h" // cpu_riscv_vlenb() +#endif + +#include "allocator.h" +#include "option.h" +#include "platform.h" + +#if NCNN_PIXEL +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 +#include +#include +#endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API +#endif // NCNN_PIXEL + +namespace ncnn { + +#if NCNN_VULKAN +class VkMat; +class VkImageMat; +#endif // NCNN_VULKAN + +// the three dimension matrix +class NCNN_EXPORT Mat +{ +public: + // empty + Mat(); + // vec + Mat(int w, size_t elemsize = 4u, Allocator* allocator = 0); + // image + Mat(int w, int h, size_t elemsize = 4u, Allocator* allocator = 0); + // dim + Mat(int w, int h, int c, size_t elemsize = 4u, Allocator* allocator = 0); + // cube + Mat(int w, int h, int d, int c, size_t elemsize = 4u, Allocator* allocator = 0); + // packed vec + Mat(int w, size_t elemsize, int elempack, Allocator* allocator = 0); + // packed image + Mat(int w, int h, size_t elemsize, int elempack, Allocator* allocator = 0); + // packed dim + Mat(int w, int h, int c, size_t elemsize, int elempack, Allocator* allocator = 0); + // packed cube + Mat(int w, int h, int d, int c, size_t elemsize, int elempack, Allocator* allocator = 0); + // copy + Mat(const Mat& m); + // external vec + Mat(int w, void* data, size_t elemsize = 4u, Allocator* allocator = 0); + // external image + Mat(int w, int h, void* data, size_t elemsize = 4u, Allocator* allocator = 0); + // external dim + Mat(int w, int h, int c, void* data, size_t elemsize = 4u, Allocator* allocator = 0); + // external cube + Mat(int w, int h, int d, int c, void* data, size_t elemsize = 4u, Allocator* allocator = 0); + // external packed vec + Mat(int w, void* data, size_t elemsize, int elempack, Allocator* allocator = 0); + // external packed image + Mat(int w, int h, void* data, size_t elemsize, int elempack, Allocator* allocator = 0); + // external packed dim + Mat(int w, int h, int c, void* data, size_t elemsize, int elempack, Allocator* allocator = 0); + // external packed cube + Mat(int w, int h, int d, int c, void* data, size_t elemsize, int elempack, Allocator* allocator = 0); + // release + ~Mat(); + // assign + Mat& operator=(const Mat& m); + // set all + void fill(float v); + void fill(int v); +#if __ARM_NEON + void fill(float32x4_t _v); + void fill(uint16x4_t _v); +#if !defined(_MSC_VER) + void fill(int32x4_t _v); +#endif + void fill(int32x4_t _v0, int32x4_t _v1); +#if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if !defined(_MSC_VER) + void fill(float16x4_t _v); + void fill(float16x8_t _v); +#endif +#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#endif // __ARM_NEON +#if __SSE2__ +#if __AVX__ +#if __AVX512F__ + void fill(const __m512& _v); +#endif // __AVX512F__ + void fill(const __m256& _v, int i = 0); +#endif // __AVX__ + void fill(const __m128& _v); + void fill(const __m128i& _v); +#endif // __SSE2__ +#if __mips_msa + void fill(v4f32 _v); +#endif // __mips_msa +#if __loongarch_sx + void fill(__m128 _v); +#endif //__loongarch_sx +#if __riscv_vector + void fill(vfloat32m1_t _v); + void fill(vuint16m1_t _v); + void fill(vint8m1_t _v); +#if __riscv_zvfh + void fill(vfloat16m1_t _v); +#endif // __riscv_zvfh +#endif // __riscv_vector + template + void fill(T v); + // deep copy + Mat clone(Allocator* allocator = 0) const; + // deep copy from other mat, inplace + void clone_from(const ncnn::Mat& mat, Allocator* allocator = 0); + // reshape vec + Mat reshape(int w, Allocator* allocator = 0) const; + // reshape image + Mat reshape(int w, int h, Allocator* allocator = 0) const; + // reshape dim + Mat reshape(int w, int h, int c, Allocator* allocator = 0) const; + // reshape cube + Mat reshape(int w, int h, int d, int c, Allocator* allocator = 0) const; + // allocate vec + void create(int w, size_t elemsize = 4u, Allocator* allocator = 0); + // allocate image + void create(int w, int h, size_t elemsize = 4u, Allocator* allocator = 0); + // allocate dim + void create(int w, int h, int c, size_t elemsize = 4u, Allocator* allocator = 0); + // allocate cube + void create(int w, int h, int d, int c, size_t elemsize = 4u, Allocator* allocator = 0); + // allocate packed vec + void create(int w, size_t elemsize, int elempack, Allocator* allocator = 0); + // allocate packed image + void create(int w, int h, size_t elemsize, int elempack, Allocator* allocator = 0); + // allocate packed dim + void create(int w, int h, int c, size_t elemsize, int elempack, Allocator* allocator = 0); + // allocate packed cube + void create(int w, int h, int d, int c, size_t elemsize, int elempack, Allocator* allocator = 0); + // allocate like + void create_like(const Mat& m, Allocator* allocator = 0); +#if NCNN_VULKAN + // allocate like + void create_like(const VkMat& m, Allocator* allocator = 0); + // allocate like + void create_like(const VkImageMat& im, Allocator* allocator = 0); +#endif // NCNN_VULKAN + // refcount++ + void addref(); + // refcount-- + void release(); + + bool empty() const; + size_t total() const; + + // bits per element + int elembits() const; + + // shape only + Mat shape() const; + + // data reference + Mat channel(int c); + const Mat channel(int c) const; + Mat depth(int z); + const Mat depth(int z) const; + float* row(int y); + const float* row(int y) const; + template + T* row(int y); + template + const T* row(int y) const; + + // range reference + Mat channel_range(int c, int channels); + const Mat channel_range(int c, int channels) const; + Mat depth_range(int z, int depths); + const Mat depth_range(int z, int depths) const; + Mat row_range(int y, int rows); + const Mat row_range(int y, int rows) const; + Mat range(int x, int n); + const Mat range(int x, int n) const; + + // access raw data + template + operator T*(); + template + operator const T*() const; + + // convenient access float vec element + float& operator[](size_t i); + const float& operator[](size_t i) const; + +#if NCNN_PIXEL + enum PixelType + { + PIXEL_CONVERT_SHIFT = 16, + PIXEL_FORMAT_MASK = 0x0000ffff, + PIXEL_CONVERT_MASK = 0xffff0000, + + PIXEL_RGB = 1, + PIXEL_BGR = 2, + PIXEL_GRAY = 3, + PIXEL_RGBA = 4, + PIXEL_BGRA = 5, + + PIXEL_RGB2BGR = PIXEL_RGB | (PIXEL_BGR << PIXEL_CONVERT_SHIFT), + PIXEL_RGB2GRAY = PIXEL_RGB | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT), + PIXEL_RGB2RGBA = PIXEL_RGB | (PIXEL_RGBA << PIXEL_CONVERT_SHIFT), + PIXEL_RGB2BGRA = PIXEL_RGB | (PIXEL_BGRA << PIXEL_CONVERT_SHIFT), + + PIXEL_BGR2RGB = PIXEL_BGR | (PIXEL_RGB << PIXEL_CONVERT_SHIFT), + PIXEL_BGR2GRAY = PIXEL_BGR | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT), + PIXEL_BGR2RGBA = PIXEL_BGR | (PIXEL_RGBA << PIXEL_CONVERT_SHIFT), + PIXEL_BGR2BGRA = PIXEL_BGR | (PIXEL_BGRA << PIXEL_CONVERT_SHIFT), + + PIXEL_GRAY2RGB = PIXEL_GRAY | (PIXEL_RGB << PIXEL_CONVERT_SHIFT), + PIXEL_GRAY2BGR = PIXEL_GRAY | (PIXEL_BGR << PIXEL_CONVERT_SHIFT), + PIXEL_GRAY2RGBA = PIXEL_GRAY | (PIXEL_RGBA << PIXEL_CONVERT_SHIFT), + PIXEL_GRAY2BGRA = PIXEL_GRAY | (PIXEL_BGRA << PIXEL_CONVERT_SHIFT), + + PIXEL_RGBA2RGB = PIXEL_RGBA | (PIXEL_RGB << PIXEL_CONVERT_SHIFT), + PIXEL_RGBA2BGR = PIXEL_RGBA | (PIXEL_BGR << PIXEL_CONVERT_SHIFT), + PIXEL_RGBA2GRAY = PIXEL_RGBA | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT), + PIXEL_RGBA2BGRA = PIXEL_RGBA | (PIXEL_BGRA << PIXEL_CONVERT_SHIFT), + + PIXEL_BGRA2RGB = PIXEL_BGRA | (PIXEL_RGB << PIXEL_CONVERT_SHIFT), + PIXEL_BGRA2BGR = PIXEL_BGRA | (PIXEL_BGR << PIXEL_CONVERT_SHIFT), + PIXEL_BGRA2GRAY = PIXEL_BGRA | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT), + PIXEL_BGRA2RGBA = PIXEL_BGRA | (PIXEL_RGBA << PIXEL_CONVERT_SHIFT), + }; + // convenient construct from pixel data + static Mat from_pixels(const unsigned char* pixels, int type, int w, int h, Allocator* allocator = 0); + // convenient construct from pixel data with stride(bytes-per-row) parameter + static Mat from_pixels(const unsigned char* pixels, int type, int w, int h, int stride, Allocator* allocator = 0); + // convenient construct from pixel data and resize to specific size + static Mat from_pixels_resize(const unsigned char* pixels, int type, int w, int h, int target_width, int target_height, Allocator* allocator = 0); + // convenient construct from pixel data and resize to specific size with stride(bytes-per-row) parameter + static Mat from_pixels_resize(const unsigned char* pixels, int type, int w, int h, int stride, int target_width, int target_height, Allocator* allocator = 0); + // convenient construct from pixel data roi + static Mat from_pixels_roi(const unsigned char* pixels, int type, int w, int h, int roix, int roiy, int roiw, int roih, Allocator* allocator = 0); + // convenient construct from pixel data roi with stride(bytes-per-row) parameter + static Mat from_pixels_roi(const unsigned char* pixels, int type, int w, int h, int stride, int roix, int roiy, int roiw, int roih, Allocator* allocator = 0); + // convenient construct from pixel data roi and resize to specific size + static Mat from_pixels_roi_resize(const unsigned char* pixels, int type, int w, int h, int roix, int roiy, int roiw, int roih, int target_width, int target_height, Allocator* allocator = 0); + // convenient construct from pixel data roi and resize to specific size with stride(bytes-per-row) parameter + static Mat from_pixels_roi_resize(const unsigned char* pixels, int type, int w, int h, int stride, int roix, int roiy, int roiw, int roih, int target_width, int target_height, Allocator* allocator = 0); + + // convenient export to pixel data + void to_pixels(unsigned char* pixels, int type) const; + // convenient export to pixel data with stride(bytes-per-row) parameter + void to_pixels(unsigned char* pixels, int type, int stride) const; + // convenient export to pixel data and resize to specific size + void to_pixels_resize(unsigned char* pixels, int type, int target_width, int target_height) const; + // convenient export to pixel data and resize to specific size with stride(bytes-per-row) parameter + void to_pixels_resize(unsigned char* pixels, int type, int target_width, int target_height, int target_stride) const; + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 + // convenient construct from android Bitmap + static Mat from_android_bitmap(JNIEnv* env, jobject bitmap, int type_to, Allocator* allocator = 0); + // convenient construct from android Bitmap and resize to specific size + static Mat from_android_bitmap_resize(JNIEnv* env, jobject bitmap, int type_to, int target_width, int target_height, Allocator* allocator = 0); + // convenient construct from android Bitmap roi + static Mat from_android_bitmap_roi(JNIEnv* env, jobject bitmap, int type_to, int roix, int roiy, int roiw, int roih, Allocator* allocator = 0); + // convenient construct from android Bitmap roi and resize to specific size + static Mat from_android_bitmap_roi_resize(JNIEnv* env, jobject bitmap, int type_to, int roix, int roiy, int roiw, int roih, int target_width, int target_height, Allocator* allocator = 0); + // convenient export to android Bitmap and resize to the android Bitmap size + void to_android_bitmap(JNIEnv* env, jobject bitmap, int type_from) const; +#endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API +#endif // NCNN_PIXEL + + // substract channel-wise mean values, then multiply by normalize values, pass 0 to skip + void substract_mean_normalize(const float* mean_vals, const float* norm_vals); + + // convenient construct from half precision floating point data + static Mat from_float16(const unsigned short* data, int size); + + // pointer to the data + void* data; + + // pointer to the reference counter + // when points to user-allocated data, the pointer is NULL + int* refcount; + + // element size in bytes + // 4 = float32/int32 + // 2 = float16 + // 1 = int8/uint8 + // 0 = empty + size_t elemsize; + + // packed count inside element + // c/1-d-h-w-1 c/1-h-w-1 h/1-w-1 w/1-1 scalar + // c/4-d-h-w-4 c/4-h-w-4 h/4-w-4 w/4-4 sse/neon + // c/8-d-h-w-8 c/8-h-w-8 h/8-w-8 w/8-8 avx/fp16 + int elempack; + + // the allocator + Allocator* allocator; + + // the dimension rank + int dims; + + int w; + int h; + int d; + int c; + + size_t cstep; +}; + +#if NCNN_VULKAN + +// the three dimension matrix, vulkan version +class NCNN_EXPORT VkMat +{ +public: + // empty + VkMat(); + // vec + VkMat(int w, size_t elemsize, VkAllocator* allocator); + // image + VkMat(int w, int h, size_t elemsize, VkAllocator* allocator); + // dim + VkMat(int w, int h, int c, size_t elemsize, VkAllocator* allocator); + // cube + VkMat(int w, int h, int d, int c, size_t elemsize, VkAllocator* allocator); + // packed vec + VkMat(int w, size_t elemsize, int elempack, VkAllocator* allocator); + // packed image + VkMat(int w, int h, size_t elemsize, int elempack, VkAllocator* allocator); + // packed dim + VkMat(int w, int h, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // packed cube + VkMat(int w, int h, int d, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // copy + VkMat(const VkMat& m); + // external vec + VkMat(int w, VkBufferMemory* data, size_t elemsize, VkAllocator* allocator); + // external image + VkMat(int w, int h, VkBufferMemory* data, size_t elemsize, VkAllocator* allocator); + // external dim + VkMat(int w, int h, int c, VkBufferMemory* data, size_t elemsize, VkAllocator* allocator); + // external cube + VkMat(int w, int h, int d, int c, VkBufferMemory* data, size_t elemsize, VkAllocator* allocator); + // external packed vec + VkMat(int w, VkBufferMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed image + VkMat(int w, int h, VkBufferMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed dim + VkMat(int w, int h, int c, VkBufferMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed cube + VkMat(int w, int h, int d, int c, VkBufferMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // release + ~VkMat(); + // assign + VkMat& operator=(const VkMat& m); + // allocate vec + void create(int w, size_t elemsize, VkAllocator* allocator); + // allocate image + void create(int w, int h, size_t elemsize, VkAllocator* allocator); + // allocate dim + void create(int w, int h, int c, size_t elemsize, VkAllocator* allocator); + // allocate cube + void create(int w, int h, int d, int c, size_t elemsize, VkAllocator* allocator); + // allocate packed vec + void create(int w, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed image + void create(int w, int h, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed dim + void create(int w, int h, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed cube + void create(int w, int h, int d, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate like + void create_like(const Mat& m, VkAllocator* allocator); + // allocate like + void create_like(const VkMat& m, VkAllocator* allocator); + // allocate like + void create_like(const VkImageMat& im, VkAllocator* allocator); + + // mapped + Mat mapped() const; + void* mapped_ptr() const; + + // refcount++ + void addref(); + // refcount-- + void release(); + + bool empty() const; + size_t total() const; + + // bits per element + int elembits() const; + + // shape only + Mat shape() const; + + // low-level reference + VkBuffer buffer() const; + size_t buffer_offset() const; + size_t buffer_capacity() const; + + // device buffer + VkBufferMemory* data; + + // pointer to the reference counter + // when points to user-allocated data, the pointer is NULL + int* refcount; + + // element size in bytes + // 4 = float32/int32 + // 2 = float16 + // 1 = int8/uint8 + // 0 = empty + size_t elemsize; + + // packed count inside element + // c/1-d-h-w-1 c/1-h-w-1 h/1-w-1 w/1-1 scalar + // c/4-d-h-w-4 c/4-h-w-4 h/4-w-4 w/4-4 sse/neon + // c/8-d-h-w-8 c/8-h-w-8 h/8-w-8 w/8-8 avx/fp16 + int elempack; + + // the allocator + VkAllocator* allocator; + + // the dimension rank + int dims; + + int w; + int h; + int d; + int c; + + size_t cstep; +}; + +class NCNN_EXPORT VkImageMat +{ +public: + // empty + VkImageMat(); + // vec + VkImageMat(int w, size_t elemsize, VkAllocator* allocator); + // image + VkImageMat(int w, int h, size_t elemsize, VkAllocator* allocator); + // dim + VkImageMat(int w, int h, int c, size_t elemsize, VkAllocator* allocator); + // cube + VkImageMat(int w, int h, int d, int c, size_t elemsize, VkAllocator* allocator); + // packed vec + VkImageMat(int w, size_t elemsize, int elempack, VkAllocator* allocator); + // packed image + VkImageMat(int w, int h, size_t elemsize, int elempack, VkAllocator* allocator); + // packed dim + VkImageMat(int w, int h, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // packed cube + VkImageMat(int w, int h, int d, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // copy + VkImageMat(const VkImageMat& m); + // external vec + VkImageMat(int w, VkImageMemory* data, size_t elemsize, VkAllocator* allocator); + // external image + VkImageMat(int w, int h, VkImageMemory* data, size_t elemsize, VkAllocator* allocator); + // external dim + VkImageMat(int w, int h, int c, VkImageMemory* data, size_t elemsize, VkAllocator* allocator); + // external cube + VkImageMat(int w, int h, int d, int c, VkImageMemory* data, size_t elemsize, VkAllocator* allocator); + // external packed vec + VkImageMat(int w, VkImageMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed image + VkImageMat(int w, int h, VkImageMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed dim + VkImageMat(int w, int h, int c, VkImageMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // external packed cube + VkImageMat(int w, int h, int d, int c, VkImageMemory* data, size_t elemsize, int elempack, VkAllocator* allocator); + // release + ~VkImageMat(); + // assign + VkImageMat& operator=(const VkImageMat& m); + // allocate vec + void create(int w, size_t elemsize, VkAllocator* allocator); + // allocate image + void create(int w, int h, size_t elemsize, VkAllocator* allocator); + // allocate dim + void create(int w, int h, int c, size_t elemsize, VkAllocator* allocator); + // allocate cube + void create(int w, int h, int d, int c, size_t elemsize, VkAllocator* allocator); + // allocate packed vec + void create(int w, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed image + void create(int w, int h, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed dim + void create(int w, int h, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate packed cube + void create(int w, int h, int d, int c, size_t elemsize, int elempack, VkAllocator* allocator); + // allocate like + void create_like(const Mat& m, VkAllocator* allocator); + // allocate like + void create_like(const VkMat& m, VkAllocator* allocator); + // allocate like + void create_like(const VkImageMat& im, VkAllocator* allocator); + + // mapped + Mat mapped() const; + void* mapped_ptr() const; + + // refcount++ + void addref(); + // refcount-- + void release(); + + bool empty() const; + size_t total() const; + + // bits per element + int elembits() const; + + // shape only + Mat shape() const; + + // low-level reference + VkImage image() const; + VkImageView imageview() const; + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 + // convenient construct from android hardware buffer + static VkImageMat from_android_hardware_buffer(VkAndroidHardwareBufferImageAllocator* allocator); +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + + // device image + VkImageMemory* data; + + // pointer to the reference counter + // when points to user-allocated data, the pointer is NULL + int* refcount; + + // element size in bytes + // 4 = float32/int32 + // 2 = float16 + // 1 = int8/uint8 + // 0 = empty + size_t elemsize; + + // packed count inside element + // c/1-d-h-w-1 c/1-h-w-1 h/1-w-1 w/1-1 scalar + // c/4-d-h-w-4 c/4-h-w-4 h/4-w-4 w/4-4 sse/neon + // c/8-d-h-w-8 c/8-h-w-8 h/8-w-8 w/8-8 avx/fp16 + int elempack; + + // the allocator + VkAllocator* allocator; + + // the dimension rank + int dims; + + int w; + int h; + int d; + int c; +}; + +// type for vulkan specialization constant and push constant +union vk_specialization_type +{ + int i; + float f; + uint32_t u32; +}; +union vk_constant_type +{ + int i; + float f; + uint32_t u32; +}; +#endif // NCNN_VULKAN + +// misc function +#if NCNN_PIXEL +// convert yuv420sp(nv21) to rgb, the fast approximate version +NCNN_EXPORT void yuv420sp2rgb(const unsigned char* yuv420sp, int w, int h, unsigned char* rgb); +// convert yuv420sp(nv12) to rgb, the fast approximate version +NCNN_EXPORT void yuv420sp2rgb_nv12(const unsigned char* yuv420sp, int w, int h, unsigned char* rgb); +// convert yuv420sp(nv21) to rgb with half resize, the faster approximate version +NCNN_EXPORT void yuv420sp2rgb_half(const unsigned char* yuv420sp, int w, int h, unsigned char* rgb); +// image pixel bilinear resize +NCNN_EXPORT void resize_bilinear_c1(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h); +NCNN_EXPORT void resize_bilinear_c2(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h); +NCNN_EXPORT void resize_bilinear_c3(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h); +NCNN_EXPORT void resize_bilinear_c4(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h); +// image pixel bilinear resize with stride(bytes-per-row) parameter +NCNN_EXPORT void resize_bilinear_c1(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride); +NCNN_EXPORT void resize_bilinear_c2(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride); +NCNN_EXPORT void resize_bilinear_c3(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride); +NCNN_EXPORT void resize_bilinear_c4(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride); +// image pixel bilinear resize, convenient wrapper for yuv420sp(nv21/nv12) +NCNN_EXPORT void resize_bilinear_yuv420sp(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h); +#endif // NCNN_PIXEL +#if NCNN_PIXEL_ROTATE +// type is the from type, 6 means rotating from 6 to 1 +// +// 1 2 3 4 5 6 7 8 +// +// 888888 888888 88 88 8888888888 88 88 8888888888 +// 88 88 88 88 88 88 88 88 88 88 88 88 +// 8888 8888 8888 8888 88 8888888888 8888888888 88 +// 88 88 88 88 +// 88 88 888888 888888 +// +// ref http://sylvana.net/jpegcrop/exif_orientation.html +// image pixel kanna rotate +NCNN_EXPORT void kanna_rotate_c1(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, int type); +NCNN_EXPORT void kanna_rotate_c2(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, int type); +NCNN_EXPORT void kanna_rotate_c3(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, int type); +NCNN_EXPORT void kanna_rotate_c4(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, int type); +// image pixel kanna rotate with stride(bytes-per-row) parameter +NCNN_EXPORT void kanna_rotate_c1(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, int type); +NCNN_EXPORT void kanna_rotate_c2(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, int type); +NCNN_EXPORT void kanna_rotate_c3(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, int type); +NCNN_EXPORT void kanna_rotate_c4(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, int type); +// image pixel kanna rotate, convenient wrapper for yuv420sp(nv21/nv12) +NCNN_EXPORT void kanna_rotate_yuv420sp(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, int type); +#endif // NCNN_PIXEL_ROTATE +#if NCNN_PIXEL_AFFINE +// resolve affine transform matrix from rotation angle, scale factor and x y offset +NCNN_EXPORT void get_rotation_matrix(float angle, float scale, float dx, float dy, float* tm); +// resolve affine transform matrix from two set of points, num_point must be >= 2 +NCNN_EXPORT void get_affine_transform(const float* points_from, const float* points_to, int num_point, float* tm); +// resolve the inversion affine transform matrix +NCNN_EXPORT void invert_affine_transform(const float* tm, float* tm_inv); +// image pixel bilinear warpaffine inverse transform, set -233 for transparent border color, the color RGBA is little-endian encoded +NCNN_EXPORT void warpaffine_bilinear_c1(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c2(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c3(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c4(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, const float* tm, int type = 0, unsigned int v = 0); +// image pixel bilinear warpaffine inverse transform with stride(bytes-per-row) parameter, set -233 for transparent border color, the color RGBA is little-endian encoded +NCNN_EXPORT void warpaffine_bilinear_c1(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c2(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c3(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, const float* tm, int type = 0, unsigned int v = 0); +NCNN_EXPORT void warpaffine_bilinear_c4(const unsigned char* src, int srcw, int srch, int srcstride, unsigned char* dst, int w, int h, int stride, const float* tm, int type = 0, unsigned int v = 0); +// image pixel bilinear warpaffine, convenient wrapper for yuv420sp(nv21/nv12), set -233 for transparent border color, the color YUV_ is little-endian encoded +NCNN_EXPORT void warpaffine_bilinear_yuv420sp(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h, const float* tm, int type = 0, unsigned int v = 0); +#endif // NCNN_PIXEL_AFFINE +#if NCNN_PIXEL_DRAWING +// draw rectangle, set thickness -1 for filled rectangle, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_rectangle_c1(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c2(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c3(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c4(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +// draw rectangle with stride(bytes-per-row) parameter, set thickness -1 for filled rectangle, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_rectangle_c1(unsigned char* pixels, int w, int h, int stride, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c2(unsigned char* pixels, int w, int h, int stride, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c3(unsigned char* pixels, int w, int h, int stride, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +NCNN_EXPORT void draw_rectangle_c4(unsigned char* pixels, int w, int h, int stride, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +// draw rectangle, convenient wrapper for yuv420sp(nv21/nv12), set thickness -1 for filled rectangle, the color YUV_ is little-endian encoded +NCNN_EXPORT void draw_rectangle_yuv420sp(unsigned char* yuv420sp, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness); +// draw circle, set thickness -1 for filled circle, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_circle_c1(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c2(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c3(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c4(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +// draw circle with stride(bytes-per-row) parameter, set thickness -1 for filled circle, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_circle_c1(unsigned char* pixels, int w, int h, int stride, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c2(unsigned char* pixels, int w, int h, int stride, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c3(unsigned char* pixels, int w, int h, int stride, int cx, int cy, int radius, unsigned int color, int thickness); +NCNN_EXPORT void draw_circle_c4(unsigned char* pixels, int w, int h, int stride, int cx, int cy, int radius, unsigned int color, int thickness); +// draw circle, convenient wrapper for yuv420sp(nv21/nv12), set thickness -1 for filled circle, the color YUV_ is little-endian encoded +NCNN_EXPORT void draw_circle_yuv420sp(unsigned char* yuv420sp, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness); +// draw line, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_line_c1(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c2(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c3(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c4(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +// draw line with stride(bytes-per-row) parameter, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_line_c1(unsigned char* pixels, int w, int h, int stride, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c2(unsigned char* pixels, int w, int h, int stride, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c3(unsigned char* pixels, int w, int h, int stride, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +NCNN_EXPORT void draw_line_c4(unsigned char* pixels, int w, int h, int stride, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +// draw line, convenient wrapper for yuv420sp(nv21/nv12), the color YUV_ is little-endian encoded +NCNN_EXPORT void draw_line_yuv420sp(unsigned char* yuv420sp, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness); +// resolve text bounding box size +NCNN_EXPORT void get_text_drawing_size(const char* text, int fontpixelsize, int* w, int* h); +// draw ascii printables and newline, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_text_c1(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c2(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c3(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c4(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +// draw ascii printables and newline with stride(bytes-per-row) parameter, the color RGBA is little-endian encoded +NCNN_EXPORT void draw_text_c1(unsigned char* pixels, int w, int h, int stride, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c2(unsigned char* pixels, int w, int h, int stride, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c3(unsigned char* pixels, int w, int h, int stride, const char* text, int x, int y, int fontpixelsize, unsigned int color); +NCNN_EXPORT void draw_text_c4(unsigned char* pixels, int w, int h, int stride, const char* text, int x, int y, int fontpixelsize, unsigned int color); +// draw ascii printables and newline, convenient wrapper for yuv420sp(nv21/nv12), the color YUV_ is little-endian encoded +NCNN_EXPORT void draw_text_yuv420sp(unsigned char* yuv420sp, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color); +#endif // NCNN_PIXEL_DRAWING + +// type conversion +// convert float to half precision floating point +NCNN_EXPORT unsigned short float32_to_float16(float value); +// convert half precision floating point to float +NCNN_EXPORT float float16_to_float32(unsigned short value); +// convert float to brain half +NCNN_EXPORT NCNN_FORCEINLINE unsigned short float32_to_bfloat16(float value) +{ + // 16 : 16 + union + { + unsigned int u; + float f; + } tmp; + tmp.f = value; + return tmp.u >> 16; +} +// convert brain half to float +NCNN_EXPORT NCNN_FORCEINLINE float bfloat16_to_float32(unsigned short value) +{ + // 16 : 16 + union + { + unsigned int u; + float f; + } tmp; + tmp.u = value << 16; + return tmp.f; +} +// convert float16 to float8 e4m3 +NCNN_EXPORT unsigned char float16_to_float8(unsigned short value); +// convert float8 e4m3 to float16 +NCNN_EXPORT unsigned short float8_to_float16(unsigned char value); +// convert float16 to bfloat8 e5m2 +NCNN_EXPORT NCNN_FORCEINLINE unsigned char float16_to_bfloat8(unsigned short value) +{ + // 1 : 5 : 10 -> 1 : 5 : 2 + // direct truncation for bfloat8 e5m2, similar to bfloat16 + return value >> 8; +} +// convert bfloat8 e5m2 to float16 +NCNN_EXPORT NCNN_FORCEINLINE unsigned short bfloat8_to_float16(unsigned char value) +{ + // 1 : 5 : 2 -> 1 : 5 : 10 + // direct extension for bfloat8 e5m2, similar to bfloat16 + return value << 8; +} + +// mat process +enum BorderType +{ + BORDER_CONSTANT = 0, + BORDER_REPLICATE = 1, + BORDER_REFLECT = 2, + BORDER_TRANSPARENT = -233, +}; +NCNN_EXPORT void copy_make_border(const Mat& src, Mat& dst, int top, int bottom, int left, int right, int type, float v, const Option& opt = Option()); +NCNN_EXPORT void copy_make_border_3d(const Mat& src, Mat& dst, int top, int bottom, int left, int right, int front, int behind, int type, float v, const Option& opt = Option()); +NCNN_EXPORT void copy_cut_border(const Mat& src, Mat& dst, int top, int bottom, int left, int right, const Option& opt = Option()); +NCNN_EXPORT void copy_cut_border_3d(const Mat& src, Mat& dst, int top, int bottom, int left, int right, int front, int behind, const Option& opt = Option()); +NCNN_EXPORT void resize_nearest(const Mat& src, Mat& dst, int w, int h, const Option& opt = Option()); +NCNN_EXPORT void resize_bilinear(const Mat& src, Mat& dst, int w, int h, const Option& opt = Option()); +NCNN_EXPORT void resize_bicubic(const Mat& src, Mat& dst, int w, int h, const Option& opt = Option()); +NCNN_EXPORT void convert_packing(const Mat& src, Mat& dst, int elempack, const Option& opt = Option()); +NCNN_EXPORT void flatten(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void cast_float32_to_float16(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void cast_float16_to_float32(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void cast_int8_to_float32(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void cast_float32_to_bfloat16(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void cast_bfloat16_to_float32(const Mat& src, Mat& dst, const Option& opt = Option()); +NCNN_EXPORT void quantize_to_int8(const Mat& src, Mat& dst, const Mat& scale_data, const Option& opt = Option()); +NCNN_EXPORT void dequantize_from_int32(const Mat& src, Mat& dst, const Mat& scale_data, const Mat& bias_data, const Option& opt = Option()); +NCNN_EXPORT void requantize_from_int32_to_int8(const Mat& src, Mat& dst, const Mat& scale_in_data, const Mat& scale_out_data, const Mat& bias_data, int activation_type, const Mat& activation_params, const Option& opt = Option()); + +NCNN_FORCEINLINE Mat::Mat() + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ +} + +NCNN_FORCEINLINE Mat::Mat(int _w, size_t _elemsize, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _elemsize, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, size_t _elemsize, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _elemsize, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _c, size_t _elemsize, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _d, int _c, size_t _elemsize, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _d, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _c, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _d, int _c, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _d, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE Mat::Mat(const Mat& m) + : data(m.data), refcount(m.refcount), elemsize(m.elemsize), elempack(m.elempack), allocator(m.allocator), dims(m.dims), w(m.w), h(m.h), d(m.d), c(m.c), cstep(m.cstep) +{ + addref(); +} + +NCNN_FORCEINLINE Mat::Mat(int _w, void* _data, size_t _elemsize, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ + cstep = alignSize(w * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, void* _data, size_t _elemsize, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _c, void* _data, size_t _elemsize, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _d, int _c, void* _data, size_t _elemsize, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ + cstep = alignSize((size_t)w * h * d * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, void* _data, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ + cstep = alignSize(w * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, void* _data, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _c, void* _data, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::Mat(int _w, int _h, int _d, int _c, void* _data, size_t _elemsize, int _elempack, Allocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ + cstep = alignSize((size_t)w * h * d * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE Mat::~Mat() +{ + release(); +} + +NCNN_FORCEINLINE void Mat::fill(float _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + + int i = 0; +#if __ARM_NEON + float32x4_t _c = vdupq_n_f32(_v); + for (; i + 3 < size; i += 4) + { + vst1q_f32(ptr, _c); + ptr += 4; + } +#endif // __ARM_NEON + for (; i < size; i++) + { + *ptr++ = _v; + } +} + +NCNN_FORCEINLINE void Mat::fill(int _v) +{ + int size = (int)total(); + int* ptr = (int*)data; + + int i = 0; +#if __ARM_NEON + int32x4_t _c = vdupq_n_s32(_v); + for (; i + 3 < size; i += 4) + { + vst1q_s32(ptr, _c); + ptr += 4; + } +#endif // __ARM_NEON + for (; i < size; i++) + { + *ptr++ = _v; + } +} + +#if __ARM_NEON +NCNN_FORCEINLINE void Mat::fill(float32x4_t _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + vst1q_f32(ptr, _v); + ptr += 4; + } +} + +NCNN_FORCEINLINE void Mat::fill(uint16x4_t _v) +{ + int size = (int)total(); + unsigned short* ptr = (unsigned short*)data; + for (int i = 0; i < size; i++) + { + vst1_u16(ptr, _v); + ptr += 4; + } +} + +#if !defined(_MSC_VER) +NCNN_FORCEINLINE void Mat::fill(int32x4_t _v) +{ + int size = (int)total(); + int* ptr = (int*)data; + for (int i = 0; i < size; i++) + { + vst1q_s32(ptr, _v); + ptr += 4; + } +} +#endif + +NCNN_FORCEINLINE void Mat::fill(int32x4_t _v0, int32x4_t _v1) +{ + int size = (int)total(); + int* ptr = (int*)data; + for (int i = 0; i < size; i++) + { + vst1q_s32(ptr, _v0); + vst1q_s32(ptr + 4, _v1); + ptr += 8; + } +} +#if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if !defined(_MSC_VER) +NCNN_FORCEINLINE void Mat::fill(float16x4_t _v) +{ + int size = (int)total(); + __fp16* ptr = (__fp16*)data; + for (int i = 0; i < size; i++) + { + vst1_f16(ptr, _v); + ptr += 4; + } +} + +NCNN_FORCEINLINE void Mat::fill(float16x8_t _v) +{ + int size = (int)total(); + __fp16* ptr = (__fp16*)data; + for (int i = 0; i < size; i++) + { + vst1q_f16(ptr, _v); + ptr += 8; + } +} +#endif +#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#endif // __ARM_NEON + +#if __SSE2__ +#if __AVX__ +#if __AVX512F__ +NCNN_FORCEINLINE void Mat::fill(const __m512& _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + _mm512_storeu_ps(ptr, _v); + ptr += 16; + } +} +#endif // __AVX512F__ +NCNN_FORCEINLINE void Mat::fill(const __m256& _v, int _i) +{ + // old gcc cannot overload __m128 and __m256 type + // add a dummy int parameter for different mangled function symbol + (void)_i; + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + _mm256_storeu_ps(ptr, _v); + ptr += 8; + } +} +#endif // __AVX__ +NCNN_FORCEINLINE void Mat::fill(const __m128& _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + _mm_storeu_ps(ptr, _v); + ptr += 4; + } +} +NCNN_FORCEINLINE void Mat::fill(const __m128i& _v) +{ + int size = (int)total(); + unsigned short* ptr = (unsigned short*)data; + for (int i = 0; i < size; i++) + { + _mm_store_si128((__m128i*)ptr, _v); + ptr += 8; + } +} +#endif // __SSE2__ + +#if __mips_msa +NCNN_FORCEINLINE void Mat::fill(v4f32 _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + __msa_st_w((v4i32)_v, ptr, 0); + ptr += 4; + } +} +#endif // __mips_msa + +#if __loongarch_sx +NCNN_FORCEINLINE void Mat::fill(__m128 _v) +{ + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + __lsx_vst(_v, ptr, 0); + ptr += 4; + } +} +#endif // __loongarch_sx + +#if __riscv_vector +NCNN_FORCEINLINE void Mat::fill(vfloat32m1_t _v) +{ + const int packn = cpu_riscv_vlenb() / 4; + const size_t vl = __riscv_vsetvl_e32m1(packn); + + int size = (int)total(); + float* ptr = (float*)data; + for (int i = 0; i < size; i++) + { + __riscv_vse32_v_f32m1(ptr, _v, vl); + ptr += packn; + } +} + +NCNN_FORCEINLINE void Mat::fill(vuint16m1_t _v) +{ + const int packn = cpu_riscv_vlenb() / 2; + const size_t vl = __riscv_vsetvl_e16m1(packn); + + int size = (int)total(); + unsigned short* ptr = (unsigned short*)data; + for (int i = 0; i < size; i++) + { + __riscv_vse16_v_u16m1(ptr, _v, vl); + ptr += packn; + } +} + +NCNN_FORCEINLINE void Mat::fill(vint8m1_t _v) +{ + const int packn = cpu_riscv_vlenb() / 1; + const size_t vl = __riscv_vsetvl_e8m1(packn); + + int size = (int)total(); + signed char* ptr = (signed char*)data; + for (int i = 0; i < size; i++) + { + __riscv_vse8_v_i8m1(ptr, _v, vl); + ptr += packn; + } +} +#if __riscv_zvfh +NCNN_FORCEINLINE void Mat::fill(vfloat16m1_t _v) +{ + const int packn = cpu_riscv_vlenb() / 2; + const size_t vl = __riscv_vsetvl_e16m1(packn); + + int size = (int)total(); + __fp16* ptr = (__fp16*)data; + for (int i = 0; i < size; i++) + { + __riscv_vse16_v_f16m1(ptr, _v, vl); + ptr += packn; + } +} +#endif // __riscv_zvfh +#endif // __riscv_vector + +template +NCNN_FORCEINLINE void Mat::fill(T _v) +{ + int size = (int)total(); + T* ptr = (T*)data; + for (int i = 0; i < size; i++) + { + ptr[i] = _v; + } +} + +NCNN_FORCEINLINE Mat& Mat::operator=(const Mat& m) +{ + if (this == &m) + return *this; + + if (m.refcount) + NCNN_XADD(m.refcount, 1); + + release(); + + data = m.data; + refcount = m.refcount; + elemsize = m.elemsize; + elempack = m.elempack; + allocator = m.allocator; + + dims = m.dims; + w = m.w; + h = m.h; + d = m.d; + c = m.c; + + cstep = m.cstep; + + return *this; +} + +NCNN_FORCEINLINE void Mat::addref() +{ + if (refcount) + NCNN_XADD(refcount, 1); +} + +NCNN_FORCEINLINE void Mat::release() +{ + if (refcount && NCNN_XADD(refcount, -1) == 1) + { + if (allocator) + allocator->fastFree(data); + else + fastFree(data); + } + + data = 0; + + elemsize = 0; + elempack = 0; + + dims = 0; + w = 0; + h = 0; + d = 0; + c = 0; + + cstep = 0; + + refcount = 0; +} + +NCNN_FORCEINLINE bool Mat::empty() const +{ + return data == 0 || total() == 0; +} + +NCNN_FORCEINLINE size_t Mat::total() const +{ + return cstep * c; +} + +NCNN_FORCEINLINE int Mat::elembits() const +{ + return elempack ? static_cast(elemsize * 8) / elempack : 0; +} + +NCNN_FORCEINLINE Mat Mat::shape() const +{ + if (dims == 1) + return Mat(w * elempack, (void*)0); + if (dims == 2) + return Mat(w, h * elempack, (void*)0); + if (dims == 3) + return Mat(w, h, c * elempack, (void*)0); + if (dims == 4) + return Mat(w, h, d, c * elempack, (void*)0); + + return Mat(); +} + +NCNN_FORCEINLINE Mat Mat::channel(int _c) +{ + Mat m(w, h, d, (unsigned char*)data + cstep * _c * elemsize, elemsize, elempack, allocator); + m.dims = dims - 1; + if (dims == 4) + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::channel(int _c) const +{ + Mat m(w, h, d, (unsigned char*)data + cstep * _c * elemsize, elemsize, elempack, allocator); + m.dims = dims - 1; + if (dims == 4) + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE Mat Mat::depth(int z) +{ + Mat m(w, h, (unsigned char*)data + (size_t)w * h * z * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::depth(int z) const +{ + Mat m(w, h, (unsigned char*)data + (size_t)w * h * z * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE float* Mat::row(int y) +{ + return (float*)((unsigned char*)data + (size_t)w * y * elemsize); +} + +NCNN_FORCEINLINE const float* Mat::row(int y) const +{ + return (const float*)((unsigned char*)data + (size_t)w * y * elemsize); +} + +template +NCNN_FORCEINLINE T* Mat::row(int y) +{ + return (T*)((unsigned char*)data + (size_t)w * y * elemsize); +} + +template +NCNN_FORCEINLINE const T* Mat::row(int y) const +{ + return (const T*)((unsigned char*)data + (size_t)w * y * elemsize); +} + +NCNN_FORCEINLINE Mat Mat::channel_range(int _c, int channels) +{ + Mat m(w, h, d, channels, (unsigned char*)data + cstep * _c * elemsize, elemsize, elempack, allocator); + m.dims = dims; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::channel_range(int _c, int channels) const +{ + Mat m(w, h, d, channels, (unsigned char*)data + cstep * _c * elemsize, elemsize, elempack, allocator); + m.dims = dims; + return m; +} + +NCNN_FORCEINLINE Mat Mat::depth_range(int z, int depths) +{ + Mat m(w, h, depths, (unsigned char*)data + (size_t)w * h * z * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::depth_range(int z, int depths) const +{ + Mat m(w, h, depths, (unsigned char*)data + (size_t)w * h * z * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * h; + return m; +} + +NCNN_FORCEINLINE Mat Mat::row_range(int y, int rows) +{ + Mat m(w, rows, (unsigned char*)data + (size_t)w * y * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * rows; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::row_range(int y, int rows) const +{ + Mat m(w, rows, (unsigned char*)data + (size_t)w * y * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)w * rows; + return m; +} + +NCNN_FORCEINLINE Mat Mat::range(int x, int n) +{ + Mat m(n, (unsigned char*)data + x * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)n; + return m; +} + +NCNN_FORCEINLINE const Mat Mat::range(int x, int n) const +{ + Mat m(n, (unsigned char*)data + x * elemsize, elemsize, elempack, allocator); + m.cstep = (size_t)n; + return m; +} + +template +NCNN_FORCEINLINE Mat::operator T*() +{ + return (T*)data; +} + +template +NCNN_FORCEINLINE Mat::operator const T*() const +{ + return (const T*)data; +} + +NCNN_FORCEINLINE float& Mat::operator[](size_t i) +{ + return ((float*)data)[i]; +} + +NCNN_FORCEINLINE const float& Mat::operator[](size_t i) const +{ + return ((const float*)data)[i]; +} + +#if NCNN_VULKAN + +NCNN_FORCEINLINE VkMat::VkMat() + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _c, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _d, int _c, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _d, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _c, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _d, int _c, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0), cstep(0) +{ + create(_w, _h, _d, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkMat::VkMat(const VkMat& m) + : data(m.data), refcount(m.refcount), elemsize(m.elemsize), elempack(m.elempack), allocator(m.allocator), dims(m.dims), w(m.w), h(m.h), d(m.d), c(m.c) +{ + addref(); + + cstep = m.cstep; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, VkBufferMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ + cstep = alignSize(w * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, VkBufferMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _c, VkBufferMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _d, int _c, VkBufferMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ + cstep = alignSize((size_t)w * h * d * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, VkBufferMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ + cstep = alignSize(w * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, VkBufferMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _c, VkBufferMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ + cstep = alignSize((size_t)w * h * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::VkMat(int _w, int _h, int _d, int _c, VkBufferMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ + cstep = alignSize((size_t)w * h * d * elemsize, 16) / elemsize; +} + +NCNN_FORCEINLINE VkMat::~VkMat() +{ + release(); +} + +NCNN_FORCEINLINE VkMat& VkMat::operator=(const VkMat& m) +{ + if (this == &m) + return *this; + + if (m.refcount) + NCNN_XADD(m.refcount, 1); + + release(); + + data = m.data; + refcount = m.refcount; + elemsize = m.elemsize; + elempack = m.elempack; + allocator = m.allocator; + + dims = m.dims; + w = m.w; + h = m.h; + d = m.d; + c = m.c; + + cstep = m.cstep; + + return *this; +} + +NCNN_FORCEINLINE Mat VkMat::mapped() const +{ + if (!allocator->mappable) + return Mat(); + + if (dims == 1) + return Mat(w, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 2) + return Mat(w, h, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 3) + return Mat(w, h, c, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 4) + return Mat(w, h, d, c, mapped_ptr(), elemsize, elempack, 0); + + return Mat(); +} + +NCNN_FORCEINLINE void* VkMat::mapped_ptr() const +{ + if (!allocator->mappable) + return 0; + + return (unsigned char*)data->mapped_ptr + data->offset; +} + +NCNN_FORCEINLINE void VkMat::addref() +{ + if (refcount) + NCNN_XADD(refcount, 1); +} + +NCNN_FORCEINLINE void VkMat::release() +{ + if (refcount && NCNN_XADD(refcount, -1) == 1) + { + if (allocator && data) + { + allocator->fastFree(data); + } + } + + data = 0; + + elemsize = 0; + elempack = 0; + + dims = 0; + w = 0; + h = 0; + d = 0; + c = 0; + + cstep = 0; + + refcount = 0; +} + +NCNN_FORCEINLINE bool VkMat::empty() const +{ + return data == 0 || total() == 0; +} + +NCNN_FORCEINLINE size_t VkMat::total() const +{ + return cstep * c; +} + +NCNN_FORCEINLINE int VkMat::elembits() const +{ + return elempack ? static_cast(elemsize) * 8 / elempack : 0; +} + +NCNN_FORCEINLINE Mat VkMat::shape() const +{ + if (dims == 1) + return Mat(w * elempack, (void*)0); + if (dims == 2) + return Mat(w, h * elempack, (void*)0); + if (dims == 3) + return Mat(w, h, c * elempack, (void*)0); + if (dims == 4) + return Mat(w, h, d, c * elempack, (void*)0); + + return Mat(); +} + +NCNN_FORCEINLINE VkBuffer VkMat::buffer() const +{ + return data->buffer; +} + +NCNN_FORCEINLINE size_t VkMat::buffer_offset() const +{ + return data->offset; +} + +NCNN_FORCEINLINE size_t VkMat::buffer_capacity() const +{ + return data->capacity; +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat() + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _c, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _d, int _c, size_t _elemsize, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _d, _c, _elemsize, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _c, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _d, int _c, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(0), refcount(0), elemsize(0), elempack(0), allocator(0), dims(0), w(0), h(0), d(0), c(0) +{ + create(_w, _h, _d, _c, _elemsize, _elempack, _allocator); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(const VkImageMat& m) + : data(m.data), refcount(m.refcount), elemsize(m.elemsize), elempack(m.elempack), allocator(m.allocator), dims(m.dims), w(m.w), h(m.h), d(m.d), c(m.c) +{ + addref(); +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, VkImageMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, VkImageMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _c, VkImageMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _d, int _c, VkImageMemory* _data, size_t _elemsize, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, VkImageMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(1), w(_w), h(1), d(1), c(1) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, VkImageMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(2), w(_w), h(_h), d(1), c(1) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _c, VkImageMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(3), w(_w), h(_h), d(1), c(_c) +{ +} + +NCNN_FORCEINLINE VkImageMat::VkImageMat(int _w, int _h, int _d, int _c, VkImageMemory* _data, size_t _elemsize, int _elempack, VkAllocator* _allocator) + : data(_data), refcount(0), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(4), w(_w), h(_h), d(_d), c(_c) +{ +} + +NCNN_FORCEINLINE VkImageMat::~VkImageMat() +{ + release(); +} + +NCNN_FORCEINLINE VkImageMat& VkImageMat::operator=(const VkImageMat& m) +{ + if (this == &m) + return *this; + + if (m.refcount) + NCNN_XADD(m.refcount, 1); + + release(); + + data = m.data; + refcount = m.refcount; + elemsize = m.elemsize; + elempack = m.elempack; + allocator = m.allocator; + + dims = m.dims; + w = m.w; + h = m.h; + d = m.d; + c = m.c; + + return *this; +} + +NCNN_FORCEINLINE Mat VkImageMat::mapped() const +{ + if (!allocator->mappable || !data->mapped_ptr) + return Mat(); + + if (dims == 1) + return Mat(w, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 2) + return Mat(w, h, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 3) + return Mat(w, h, c, mapped_ptr(), elemsize, elempack, 0); + + if (dims == 4) + return Mat(w, h, d, c, mapped_ptr(), elemsize, elempack, 0); + + return Mat(); +} + +NCNN_FORCEINLINE void* VkImageMat::mapped_ptr() const +{ + if (!allocator->mappable || !data->mapped_ptr) + return 0; + + return (unsigned char*)data->mapped_ptr + data->bind_offset; +} + +NCNN_FORCEINLINE void VkImageMat::addref() +{ + if (refcount) + NCNN_XADD(refcount, 1); +} + +NCNN_FORCEINLINE void VkImageMat::release() +{ + if (refcount && NCNN_XADD(refcount, -1) == 1) + { + if (allocator && data) + { + allocator->fastFree(data); + } + } + + data = 0; + + elemsize = 0; + elempack = 0; + + dims = 0; + w = 0; + h = 0; + d = 0; + c = 0; + + refcount = 0; +} + +NCNN_FORCEINLINE bool VkImageMat::empty() const +{ + return data == 0 || total() == 0; +} + +NCNN_FORCEINLINE size_t VkImageMat::total() const +{ + return w * h * d * c; +} + +NCNN_FORCEINLINE int VkImageMat::elembits() const +{ + return elempack ? static_cast(elemsize) * 8 / elempack : 0; +} + +NCNN_FORCEINLINE Mat VkImageMat::shape() const +{ + if (dims == 1) + return Mat(w * elempack, (void*)0); + if (dims == 2) + return Mat(w, h * elempack, (void*)0); + if (dims == 3) + return Mat(w, h, c * elempack, (void*)0); + if (dims == 4) + return Mat(w, h, d, c * elempack, (void*)0); + + return Mat(); +} + +NCNN_FORCEINLINE VkImage VkImageMat::image() const +{ + return data->image; +} + +NCNN_FORCEINLINE VkImageView VkImageMat::imageview() const +{ + return data->imageview; +} + +#endif // NCNN_VULKAN + +} // namespace ncnn + +#endif // NCNN_MAT_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/modelbin.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/modelbin.h new file mode 100644 index 0000000..2b31e2e --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/modelbin.h @@ -0,0 +1,69 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_MODELBIN_H +#define NCNN_MODELBIN_H + +#include "mat.h" + +namespace ncnn { + +class DataReader; +class NCNN_EXPORT ModelBin +{ +public: + ModelBin(); + virtual ~ModelBin(); + // element type + // 0 = auto + // 1 = float32 + // 2 = float16 + // 3 = int8 + // load vec + virtual Mat load(int w, int type) const; + // load image + virtual Mat load(int w, int h, int type) const; + // load dim + virtual Mat load(int w, int h, int c, int type) const; + // load cube + virtual Mat load(int w, int h, int d, int c, int type) const; +}; + +class ModelBinFromDataReaderPrivate; +class NCNN_EXPORT ModelBinFromDataReader : public ModelBin +{ +public: + explicit ModelBinFromDataReader(const DataReader& dr); + virtual ~ModelBinFromDataReader(); + + virtual Mat load(int w, int type) const; + +private: + ModelBinFromDataReader(const ModelBinFromDataReader&); + ModelBinFromDataReader& operator=(const ModelBinFromDataReader&); + +private: + ModelBinFromDataReaderPrivate* const d; +}; + +class ModelBinFromMatArrayPrivate; +class NCNN_EXPORT ModelBinFromMatArray : public ModelBin +{ +public: + // construct from weight blob array + explicit ModelBinFromMatArray(const Mat* weights); + virtual ~ModelBinFromMatArray(); + + virtual Mat load(int w, int type) const; + +private: + ModelBinFromMatArray(const ModelBinFromMatArray&); + ModelBinFromMatArray& operator=(const ModelBinFromMatArray&); + +private: + ModelBinFromMatArrayPrivate* const d; +}; + +} // namespace ncnn + +#endif // NCNN_MODELBIN_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/ncnn_export.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/ncnn_export.h new file mode 100644 index 0000000..594a005 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/ncnn_export.h @@ -0,0 +1,43 @@ + +#ifndef NCNN_EXPORT_H +#define NCNN_EXPORT_H + +#ifdef NCNN_STATIC_DEFINE +# define NCNN_EXPORT +# define NCNN_NO_EXPORT +#else +# ifndef NCNN_EXPORT +# ifdef ncnn_EXPORTS + /* We are building this library */ +# define NCNN_EXPORT +# else + /* We are using this library */ +# define NCNN_EXPORT +# endif +# endif + +# ifndef NCNN_NO_EXPORT +# define NCNN_NO_EXPORT +# endif +#endif + +#ifndef NCNN_DEPRECATED +# define NCNN_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef NCNN_DEPRECATED_EXPORT +# define NCNN_DEPRECATED_EXPORT NCNN_EXPORT NCNN_DEPRECATED +#endif + +#ifndef NCNN_DEPRECATED_NO_EXPORT +# define NCNN_DEPRECATED_NO_EXPORT NCNN_NO_EXPORT NCNN_DEPRECATED +#endif + +/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */ +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef NCNN_NO_DEPRECATED +# define NCNN_NO_DEPRECATED +# endif +#endif + +#endif /* NCNN_EXPORT_H */ diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/net.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/net.h new file mode 100644 index 0000000..ae3deae --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/net.h @@ -0,0 +1,252 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_NET_H +#define NCNN_NET_H + +#include "blob.h" +#include "layer.h" +#include "mat.h" +#include "option.h" +#include "platform.h" + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 +#include +#endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API + +namespace ncnn { + +#if NCNN_VULKAN +class VkCompute; +#endif // NCNN_VULKAN +class DataReader; +class Extractor; +class NetPrivate; +class NCNN_EXPORT Net +{ +public: + // empty init + Net(); + // clear and destroy + virtual ~Net(); + +public: + // option can be changed before loading + Option opt; + +#if NCNN_VULKAN + // set gpu device by index + void set_vulkan_device(int device_index); + + // set gpu device by device handle, no owner transfer + void set_vulkan_device(const VulkanDevice* vkdev); + + const VulkanDevice* vulkan_device() const; +#endif // NCNN_VULKAN + +#if NCNN_STRING + // register custom layer or overwrite built-in layer by layer type name + // return 0 if success + int register_custom_layer(const char* type, layer_creator_func creator, layer_destroyer_func destroyer = 0, void* userdata = 0); + virtual int custom_layer_to_index(const char* type); +#endif // NCNN_STRING + // register custom layer or overwrite built-in layer by layer type + // return 0 if success + int register_custom_layer(int index, layer_creator_func creator, layer_destroyer_func destroyer = 0, void* userdata = 0); + +#if NCNN_STRING + int load_param(const DataReader& dr); +#endif // NCNN_STRING + + int load_param_bin(const DataReader& dr); + + int load_model(const DataReader& dr); + +#if NCNN_STDIO +#if NCNN_STRING + // load network structure from plain param file + // return 0 if success + int load_param(FILE* fp); + int load_param(const char* protopath); +#if _WIN32 + int load_param(const wchar_t* protopath); +#endif + + // load network structure from in-memory plain param string, must be NULL-terminated + // return 0 if success + int load_param_mem(const char* mem); +#endif // NCNN_STRING + // load network structure from binary param file + // return 0 if success + int load_param_bin(FILE* fp); + int load_param_bin(const char* protopath); +#if _WIN32 + int load_param_bin(const wchar_t* protopath); +#endif + + // load network weight data from model file + // return 0 if success + int load_model(FILE* fp); + int load_model(const char* modelpath); +#if _WIN32 + int load_model(const wchar_t* modelpath); +#endif +#endif // NCNN_STDIO + + // load network structure from external memory + // memory pointer must be 32-bit aligned + // return bytes consumed + size_t load_param(const unsigned char* mem); + + // reference network weight data from external memory + // weight data is not copied but referenced + // so external memory should be retained when used + // memory pointer must be 32-bit aligned + // return bytes consumed + size_t load_model(const unsigned char* mem); + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 9 +#if NCNN_STRING + // convenient load network structure from android asset plain param file + int load_param(AAsset* asset); + int load_param(AAssetManager* mgr, const char* assetpath); +#endif // NCNN_STRING + // convenient load network structure from android asset binary param file + int load_param_bin(AAsset* asset); + int load_param_bin(AAssetManager* mgr, const char* assetpath); + + // convenient load network weight data from android asset model file + int load_model(AAsset* asset); + int load_model(AAssetManager* mgr, const char* assetpath); +#endif // __ANDROID_API__ >= 9 +#endif // NCNN_PLATFORM_API + + // unload network structure and weight data + void clear(); + + // construct an Extractor from network + Extractor create_extractor() const; + + // get input/output indexes/names + const std::vector& input_indexes() const; + const std::vector& output_indexes() const; +#if NCNN_STRING + const std::vector& input_names() const; + const std::vector& output_names() const; +#endif + + const std::vector& blobs() const; + const std::vector& layers() const; + + std::vector& mutable_blobs(); + std::vector& mutable_layers(); + +protected: + friend class Extractor; +#if NCNN_STRING + int find_blob_index_by_name(const char* name) const; + int find_layer_index_by_name(const char* name) const; + virtual Layer* create_custom_layer(const char* type); + virtual Layer* create_overwrite_builtin_layer(const char* type); +#endif // NCNN_STRING + virtual Layer* create_custom_layer(int index); + virtual Layer* create_overwrite_builtin_layer(int typeindex); + +private: + Net(const Net&); + Net& operator=(const Net&); + +private: + NetPrivate* const d; +}; + +class ExtractorPrivate; +class NCNN_EXPORT Extractor +{ +public: + virtual ~Extractor(); + + // copy + Extractor(const Extractor&); + + // assign + Extractor& operator=(const Extractor&); + + // clear blob mats and alloctors + void clear(); + + // enable light mode + // intermediate blob will be recycled when enabled + // enabled by default + void set_light_mode(bool enable); + + // set blob memory allocator + void set_blob_allocator(Allocator* allocator); + + // set workspace memory allocator + void set_workspace_allocator(Allocator* allocator); + +#if NCNN_VULKAN + void set_blob_vkallocator(VkAllocator* allocator); + + void set_workspace_vkallocator(VkAllocator* allocator); + + void set_staging_vkallocator(VkAllocator* allocator); +#endif // NCNN_VULKAN + +#if NCNN_STRING + // set input by blob name + // return 0 if success + int input(const char* blob_name, const Mat& in); + + // get result by blob name + // return 0 if success + // type = 0, default + // type = 1, do not convert fp16/bf16 or / and packing + int extract(const char* blob_name, Mat& feat, int type = 0); +#endif // NCNN_STRING + + // set input by blob index + // return 0 if success + int input(int blob_index, const Mat& in); + + // get result by blob index + // return 0 if success + // type = 0, default + // type = 1, do not convert fp16/bf16 or / and packing + int extract(int blob_index, Mat& feat, int type = 0); + +#if NCNN_VULKAN +#if NCNN_STRING + // set input by blob name + // return 0 if success + int input(const char* blob_name, const VkMat& in); + + // get result by blob name + // return 0 if success + int extract(const char* blob_name, VkMat& feat, VkCompute& cmd); +#endif // NCNN_STRING + + // set input by blob index + // return 0 if success + int input(int blob_index, const VkMat& in); + + // get result by blob index + // return 0 if success + int extract(int blob_index, VkMat& feat, VkCompute& cmd); +#endif // NCNN_VULKAN + +protected: + friend Extractor Net::create_extractor() const; + Extractor(const Net* net, size_t blob_count); + +private: + ExtractorPrivate* const d; +}; + +} // namespace ncnn + +#endif // NCNN_NET_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/option.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/option.h new file mode 100644 index 0000000..b65cb57 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/option.h @@ -0,0 +1,155 @@ +// Copyright 2019 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_OPTION_H +#define NCNN_OPTION_H + +#include "platform.h" + +namespace ncnn { + +#if NCNN_VULKAN +class VkAllocator; +class PipelineCache; +#endif // NCNN_VULKAN + +class Allocator; +class NCNN_EXPORT Option +{ +public: + // default option + Option(); + +public: + // light mode + // intermediate blob will be recycled when enabled + // enabled by default + bool lightmode; + + bool use_reserved_m0; + + // enable subgroup in shader + bool use_subgroup_ops; + + bool use_reserved_0; + + // thread count + // default value is the one returned by get_cpu_count() + int num_threads; + + // blob memory allocator + Allocator* blob_allocator; + + // workspace memory allocator + Allocator* workspace_allocator; + +#if NCNN_VULKAN + // blob memory allocator + VkAllocator* blob_vkallocator; + + // workspace memory allocator + VkAllocator* workspace_vkallocator; + + // staging memory allocator + VkAllocator* staging_vkallocator; + + // pipeline cache + PipelineCache* pipeline_cache; +#endif // NCNN_VULKAN + + // the time openmp threads busy-wait for more work before going to sleep + // default value is 20ms to keep the cores enabled + // without too much extra power consumption afterwards + int openmp_blocktime; + + // enable winograd convolution optimization + // improve convolution 3x3 stride1 performance, may consume more memory + // changes should be applied before loading network structure and weight + // enabled by default + bool use_winograd_convolution; + + // enable sgemm convolution optimization + // improve convolution 1x1 stride1 performance, may consume more memory + // changes should be applied before loading network structure and weight + // enabled by default + bool use_sgemm_convolution; + + // enable quantized int8 inference + // use low-precision int8 path for quantized model + // changes should be applied before loading network structure and weight + // enabled by default + bool use_int8_inference; + + // enable vulkan compute + bool use_vulkan_compute; + + // enable bf16 data type for storage + // improve most operator performance on all arm devices, may consume more memory + bool use_bf16_storage; + + // enable options for gpu inference + bool use_fp16_packed; + bool use_fp16_storage; + bool use_fp16_arithmetic; + bool use_int8_packed; + bool use_int8_storage; + bool use_int8_arithmetic; + + // enable simd-friendly packed memory layout + // improve all operator performance on all arm devices, will consume more memory + // changes should be applied before loading network structure and weight + // enabled by default + bool use_packing_layout; + + // the vulkan device + int vulkan_device_index; + + // enable options for gpu inference + bool use_bf16_packed; + + bool use_tensor_storage; + + bool use_reserved_1p; + bool use_weights_in_host_memory; + + // enable DAZ(Denormals-Are-Zero) and FTZ(Flush-To-Zero) + // default value is 3 + // 0 = DAZ OFF, FTZ OFF + // 1 = DAZ ON , FTZ OFF + // 2 = DAZ OFF, FTZ ON + // 3 = DAZ ON, FTZ ON + unsigned char flush_denormals; + + bool use_reserved_2f; + bool use_reserved_3f; + bool use_mapped_model_loading; + + bool use_local_pool_allocator; + + // enable local memory optimization for gpu inference + bool use_shader_local_memory; + + // enable cooperative matrix optimization for gpu inference + bool use_cooperative_matrix; + + // more fine-grained control of winograd convolution + bool use_winograd23_convolution; + bool use_winograd43_convolution; + bool use_winograd63_convolution; + + // this option is turned on for A53/A55 automatically + // but you can force this on/off if you wish + bool use_a53_a55_optimized_kernel; + + // enable options for shared variables in gpu shader + bool use_fp16_uniform; + bool use_int8_uniform; + + bool use_reserved_9; + bool use_reserved_10; + bool use_reserved_11; +}; + +} // namespace ncnn + +#endif // NCNN_OPTION_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/paramdict.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/paramdict.h new file mode 100644 index 0000000..2acdb7a --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/paramdict.h @@ -0,0 +1,66 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_PARAMDICT_H +#define NCNN_PARAMDICT_H + +#include "mat.h" + +// at most 32 parameters +#define NCNN_MAX_PARAM_COUNT 32 + +namespace ncnn { + +class DataReader; +class Net; +class ParamDictPrivate; +class NCNN_EXPORT ParamDict +{ +public: + // empty + ParamDict(); + + virtual ~ParamDict(); + + // copy + ParamDict(const ParamDict&); + + // assign + ParamDict& operator=(const ParamDict&); + + // get type + int type(int id) const; + + // get int + int get(int id, int def) const; + // get float + float get(int id, float def) const; + // get array + Mat get(int id, const Mat& def) const; + // get string + std::string get(int id, const std::string& def) const; + + // set int + void set(int id, int i); + // set float + void set(int id, float f); + // set array + void set(int id, const Mat& v); + // set string + void set(int id, const std::string& s); + +protected: + friend class Net; + + void clear(); + + int load_param(const DataReader& dr); + int load_param_bin(const DataReader& dr); + +private: + ParamDictPrivate* const d; +}; + +} // namespace ncnn + +#endif // NCNN_PARAMDICT_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/pipeline.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/pipeline.h new file mode 100644 index 0000000..0a3a9ba --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/pipeline.h @@ -0,0 +1,101 @@ +// Copyright 2019 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_PIPELINE_H +#define NCNN_PIPELINE_H + +#include "mat.h" +#include "platform.h" +#if NCNN_VULKAN +#include "gpu.h" +#endif // NCNN_VULKAN + +namespace ncnn { + +#if NCNN_VULKAN +class Option; +class PipelinePrivate; +class NCNN_EXPORT Pipeline +{ +public: + explicit Pipeline(const VulkanDevice* vkdev); + virtual ~Pipeline(); + +public: + void set_optimal_local_size_xyz(int w = 4, int h = 4, int c = 4); + void set_optimal_local_size_xyz(const Mat& local_size_xyz); + void set_local_size_xyz(int w, int h, int c); + void set_subgroup_size(uint32_t subgroup_size); + + int create(const uint32_t* spv_data, size_t spv_data_size, const std::vector& specializations); + + int create(int shader_type_index, const Option& opt, const std::vector& specializations); + +public: + VkShaderModule shader_module() const; + VkDescriptorSetLayout descriptorset_layout() const; + VkPipelineLayout pipeline_layout() const; + VkPipeline pipeline() const; + VkDescriptorUpdateTemplateKHR descriptor_update_template() const; + + const ShaderInfo& shader_info() const; + + uint32_t local_size_x() const; + uint32_t local_size_y() const; + uint32_t local_size_z() const; + +protected: + void set_shader_module(VkShaderModule shader_module); + void set_descriptorset_layout(VkDescriptorSetLayout descriptorset_layout); + void set_pipeline_layout(VkPipelineLayout pipeline_layout); + void set_pipeline(VkPipeline pipeline); + void set_descriptor_update_template(VkDescriptorUpdateTemplateKHR descriptor_update_template); + + void set_shader_info(const ShaderInfo& shader_info); + +public: + const VulkanDevice* vkdev; + +private: + Pipeline(const Pipeline&); + Pipeline& operator=(const Pipeline&); + +private: + PipelinePrivate* const d; +}; + +#if NCNN_PLATFORM_API +#if __ANDROID_API__ >= 26 +class VkCompute; +class NCNN_EXPORT ImportAndroidHardwareBufferPipeline : private Pipeline +{ +public: + explicit ImportAndroidHardwareBufferPipeline(const VulkanDevice* vkdev); + virtual ~ImportAndroidHardwareBufferPipeline(); + + int create(VkAndroidHardwareBufferImageAllocator* ahb_im_allocator, int type_to, int rotate_from, const Option& opt); + int create(VkAndroidHardwareBufferImageAllocator* ahb_im_allocator, int type_to, int rotate_from, int target_width, int target_height, const Option& opt); + void destroy(); + + friend class VkCompute; + +protected: + int create_shader_module(const Option& opt); + int create_sampler(VkAndroidHardwareBufferImageAllocator* ahb_im_allocator); + int create_descriptorset_layout(); + +public: + int type_to; + int rotate_from; + bool need_resize; + + VkSampler sampler; +}; +#endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API + +#endif // NCNN_VULKAN + +} // namespace ncnn + +#endif // NCNN_PIPELINE_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/pipelinecache.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/pipelinecache.h new file mode 100644 index 0000000..0edee22 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/pipelinecache.h @@ -0,0 +1,91 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_PIPELINECACHE_H +#define NCNN_PIPELINECACHE_H + +#include "platform.h" + +#include "mat.h" +#include "gpu.h" + +#if NCNN_STDIO +#include +#endif + +namespace ncnn { + +#if NCNN_VULKAN + +class VulkanDevice; +class PipelineCachePrivate; +class NCNN_EXPORT PipelineCache +{ +public: + explicit PipelineCache(const VulkanDevice* _vkdev); + + virtual ~PipelineCache(); + + void clear(); + size_t size() const; + + int save_cache(std::vector& data) const; + int load_cache(const unsigned char* data, size_t size) const; + int load_cache(const std::vector& data) const; + +#if NCNN_STDIO + int save_cache(FILE* fp) const; + int load_cache(FILE* fp) const; + int save_cache(const char* path) const; + int load_cache(const char* path) const; +#if _WIN32 + int save_cache(const wchar_t* path) const; + int load_cache(const wchar_t* path) const; +#endif // _WIN32 +#endif // NCNN_STDIO + + int get_pipeline(const uint32_t* spv_data, size_t spv_data_size, const std::vector& specializations, + uint32_t local_size_x, uint32_t local_size_y, uint32_t local_size_z, uint32_t subgroup_size, + VkShaderModule* shader_module, + VkDescriptorSetLayout* descriptorset_layout, + VkPipelineLayout* pipeline_layout, + VkPipeline* pipeline, + VkDescriptorUpdateTemplateKHR* descriptor_update_template, + ShaderInfo& shader_info) const; + + int get_pipeline(int shader_type_index, const Option& opt, const std::vector& specializations, + uint32_t local_size_x, uint32_t local_size_y, uint32_t local_size_z, uint32_t subgroup_size, + VkShaderModule* shader_module, + VkDescriptorSetLayout* descriptorset_layout, + VkPipelineLayout* pipeline_layout, + VkPipeline* pipeline, + VkDescriptorUpdateTemplateKHR* descriptor_update_template, + ShaderInfo& shader_info) const; + +protected: + int create_shader_module(int shader_type_index, const Option& opt, + uint32_t local_size_x, uint32_t local_size_y, uint32_t local_size_z, + VkShaderModule* _shader_module, ShaderInfo& si) const; + + int new_pipeline(VkShaderModule shader_module, const ShaderInfo& shader_info, const std::vector& specializations, uint32_t subgroup_size, + VkDescriptorSetLayout* descriptorset_layout, + VkPipelineLayout* pipeline_layout, + VkPipeline* pipeline, + VkDescriptorUpdateTemplateKHR* descriptor_update_template) const; + +protected: + const VulkanDevice* vkdev; + +private: + PipelineCache(const PipelineCache&); + PipelineCache& operator=(const PipelineCache&); + +private: + PipelineCachePrivate* const d; +}; + +#endif // NCNN_VULKAN + +} // namespace ncnn + +#endif // NCNN_PIPELINECACHE_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/platform.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/platform.h new file mode 100644 index 0000000..f206049 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/platform.h @@ -0,0 +1,495 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_PLATFORM_H +#define NCNN_PLATFORM_H + +#define NCNN_STDIO 1 +#define NCNN_STRING 1 +#define NCNN_SIMPLEOCV 0 +#define NCNN_SIMPLEOMP 0 +#define NCNN_SIMPLESTL 0 +#define NCNN_SIMPLEMATH 0 +#define NCNN_THREADS 1 +#define NCNN_BENCHMARK 0 +#define NCNN_C_API 1 +#define NCNN_PLATFORM_API 1 +#define NCNN_WINXP 0 +#define NCNN_PIXEL 1 +#define NCNN_PIXEL_ROTATE 1 +#define NCNN_PIXEL_AFFINE 1 +#define NCNN_PIXEL_DRAWING 1 +#define NCNN_VULKAN 1 +#define NCNN_SIMPLEVK 1 +#define NCNN_SYSTEM_GLSLANG 0 +#define NCNN_RUNTIME_CPU 1 +#define NCNN_GNU_INLINE_ASM 1 +#define NCNN_AVX 0 +#define NCNN_XOP 0 +#define NCNN_FMA 0 +#define NCNN_F16C 0 +#define NCNN_AVX2 0 +#define NCNN_AVXVNNI 0 +#define NCNN_AVXVNNIINT8 0 +#define NCNN_AVXVNNIINT16 0 +#define NCNN_AVXNECONVERT 0 +#define NCNN_AVX512 0 +#define NCNN_AVX512VNNI 0 +#define NCNN_AVX512BF16 0 +#define NCNN_AVX512FP16 0 +#define NCNN_VFPV4 1 +#define NCNN_ARM82 0 +#define NCNN_ARM82DOT 0 +#define NCNN_ARM82FP16FML 0 +#define NCNN_ARM84BF16 0 +#define NCNN_ARM84I8MM 0 +#define NCNN_ARM86SVE 0 +#define NCNN_ARM86SVE2 0 +#define NCNN_ARM86SVEBF16 0 +#define NCNN_ARM86SVEI8MM 0 +#define NCNN_ARM86SVEF32MM 0 +#define NCNN_MSA 0 +#define NCNN_LSX 0 +#define NCNN_LASX 0 +#define NCNN_MMI 0 +#define NCNN_RVV 0 +#define NCNN_ZFH 0 +#define NCNN_ZVFH 0 +#define NCNN_XTHEADVECTOR 0 +#define NCNN_INT8 1 +#define NCNN_BF16 1 +#define NCNN_FORCE_INLINE 1 + +#define NCNN_VERSION_STRING "1.0.20260526" +#define NCNN_VERSION_NUMBER 20260526 + +#include "ncnn_export.h" + +#ifdef __cplusplus + +#if defined _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#elif defined __ANDROID__ || defined __OHOS__ || defined __linux__ || __APPLE__ +#include +#include +#include +#include +#include +#endif + +#if NCNN_THREADS +#if defined _WIN32 +#include +#else +#include +#endif +#endif // NCNN_THREADS + +#if __ANDROID_API__ >= 26 +#ifndef VK_USE_PLATFORM_ANDROID_KHR +#define VK_USE_PLATFORM_ANDROID_KHR +#endif +#endif // __ANDROID_API__ >= 26 + +#include + +namespace ncnn { + +#if NCNN_THREADS +#if defined _WIN32 +#if NCNN_WINXP +class NCNN_EXPORT Mutex +{ +public: + Mutex() { InitializeCriticalSection(&cs); } + ~Mutex() { DeleteCriticalSection(&cs); } + void lock() { EnterCriticalSection(&cs); } + void unlock() { LeaveCriticalSection(&cs); } +private: + friend class ConditionVariable; + CRITICAL_SECTION cs; +}; + +class NCNN_EXPORT ConditionVariable +{ +public: + ConditionVariable() + { + signal_event = CreateEvent(0, FALSE, FALSE, 0); // Auto-reset event for signal() + broadcast_event = CreateEvent(0, TRUE, FALSE, 0); // Manual-reset event for broadcast() + } + ~ConditionVariable() + { + CloseHandle(signal_event); + CloseHandle(broadcast_event); + } + void wait(Mutex& mutex) + { + mutex.unlock(); + HANDLE events[2] = { signal_event, broadcast_event }; + WaitForMultipleObjects(2, events, FALSE, INFINITE); // Wait for either signal or broadcast + mutex.lock(); + } + void broadcast() + { + SetEvent(broadcast_event); // Wake all threads + ResetEvent(broadcast_event); // Reset after waking all threads + } + void signal() + { + SetEvent(signal_event); // Wake one thread + } +private: + HANDLE signal_event; + HANDLE broadcast_event; +}; +#else // NCNN_WINXP +class NCNN_EXPORT Mutex +{ +public: + Mutex() { InitializeSRWLock(&srwlock); } + ~Mutex() {} + void lock() { AcquireSRWLockExclusive(&srwlock); } + void unlock() { ReleaseSRWLockExclusive(&srwlock); } +private: + friend class ConditionVariable; + SRWLOCK srwlock; +}; + +class NCNN_EXPORT ConditionVariable +{ +public: + ConditionVariable() { InitializeConditionVariable(&condvar); } + ~ConditionVariable() {} + void wait(Mutex& mutex) { SleepConditionVariableSRW(&condvar, &mutex.srwlock, INFINITE, 0); } + void broadcast() { WakeAllConditionVariable(&condvar); } + void signal() { WakeConditionVariable(&condvar); } +private: + CONDITION_VARIABLE condvar; +}; +#endif // NCNN_WINXP + +static unsigned __stdcall start_wrapper(void* args); +class NCNN_EXPORT Thread +{ +public: + Thread(void* (*start)(void*), void* args = 0) { _start = start; _args = args; handle = (HANDLE)_beginthreadex(0, 0, start_wrapper, this, 0, 0); } + ~Thread() {} + void join() { WaitForSingleObject(handle, INFINITE); CloseHandle(handle); } +private: + friend unsigned __stdcall start_wrapper(void* args) + { + Thread* t = (Thread*)args; + t->_start(t->_args); + return 0; + } + HANDLE handle; + void* (*_start)(void*); + void* _args; +}; + +class NCNN_EXPORT ThreadLocalStorage +{ +public: + ThreadLocalStorage() { key = TlsAlloc(); } + ~ThreadLocalStorage() { TlsFree(key); } + void set(void* value) { TlsSetValue(key, (LPVOID)value); } + void* get() { return (void*)TlsGetValue(key); } +private: + DWORD key; +}; +#else // defined _WIN32 +class NCNN_EXPORT Mutex +{ +public: + Mutex() { pthread_mutex_init(&mutex, 0); } + ~Mutex() { pthread_mutex_destroy(&mutex); } + void lock() { pthread_mutex_lock(&mutex); } + void unlock() { pthread_mutex_unlock(&mutex); } +private: + friend class ConditionVariable; + pthread_mutex_t mutex; +}; + +class NCNN_EXPORT ConditionVariable +{ +public: + ConditionVariable() { pthread_cond_init(&cond, 0); } + ~ConditionVariable() { pthread_cond_destroy(&cond); } + void wait(Mutex& mutex) { pthread_cond_wait(&cond, &mutex.mutex); } + void broadcast() { pthread_cond_broadcast(&cond); } + void signal() { pthread_cond_signal(&cond); } +private: + pthread_cond_t cond; +}; + +class NCNN_EXPORT Thread +{ +public: + Thread(void* (*start)(void*), void* args = 0) { pthread_create(&t, 0, start, args); } + ~Thread() {} + void join() { pthread_join(t, 0); } +private: + pthread_t t; +}; + +class NCNN_EXPORT ThreadLocalStorage +{ +public: + ThreadLocalStorage() { pthread_key_create(&key, 0); } + ~ThreadLocalStorage() { pthread_key_delete(key); } + void set(void* value) { pthread_setspecific(key, value); } + void* get() { return pthread_getspecific(key); } +private: + pthread_key_t key; +}; +#endif // defined _WIN32 +#else // NCNN_THREADS +class NCNN_EXPORT Mutex +{ +public: + Mutex() {} + ~Mutex() {} + void lock() {} + void unlock() {} +}; + +class NCNN_EXPORT ConditionVariable +{ +public: + ConditionVariable() {} + ~ConditionVariable() {} + void wait(Mutex& /*mutex*/) {} + void broadcast() {} + void signal() {} +}; + +class NCNN_EXPORT Thread +{ +public: + Thread(void* (*/*start*/)(void*), void* /*args*/ = 0) {} + ~Thread() {} + void join() {} +}; + +class NCNN_EXPORT ThreadLocalStorage +{ +public: + ThreadLocalStorage() { data = 0; } + ~ThreadLocalStorage() {} + void set(void* value) { data = value; } + void* get() { return data; } +private: + void* data; +}; +#endif // NCNN_THREADS + +class NCNN_EXPORT MutexLockGuard +{ +public: + MutexLockGuard(Mutex& _mutex) : mutex(_mutex) { mutex.lock(); } + ~MutexLockGuard() { mutex.unlock(); } +private: + Mutex& mutex; +}; + +#if defined _WIN32 +class NCNN_EXPORT MappedFile +{ +public: + MappedFile() { ptr = 0; _size = 0; file = INVALID_HANDLE_VALUE; mapping = 0; } + ~MappedFile() { close(); } + int open(const char* path) + { + close(); + + file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (file == INVALID_HANDLE_VALUE) return -1; + + LARGE_INTEGER liSize; + if (!GetFileSizeEx(file, &liSize)) { close(); return -1; } + + _size = (size_t)liSize.QuadPart; + if (_size == 0) { close(); return -1; } + + mapping = CreateFileMapping(file, NULL, PAGE_READONLY, 0, 0, NULL); + if (!mapping) { close(); return -1; } + + ptr = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0); + if (!ptr) { close(); return -1; } + return 0; + } + int open(const wchar_t* path) + { + close(); + + file = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (file == INVALID_HANDLE_VALUE) return -1; + + LARGE_INTEGER liSize; + if (!GetFileSizeEx(file, &liSize)) { close(); return -1; } + + _size = (size_t)liSize.QuadPart; + if (_size == 0) { close(); return -1; } + + mapping = CreateFileMapping(file, NULL, PAGE_READONLY, 0, 0, NULL); + if (!mapping) { close(); return -1; } + + ptr = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0); + if (!ptr) { close(); return -1; } + return 0; + } + void close() + { + if (ptr) { UnmapViewOfFile(ptr); ptr = 0; } + if (mapping) { CloseHandle(mapping); mapping = 0; } + if (file != INVALID_HANDLE_VALUE) { CloseHandle(file); file = INVALID_HANDLE_VALUE; } + _size = 0; + } + const void* mapped_ptr() const { return ptr; } + size_t size() const { return _size; } +private: + void* ptr; + size_t _size; + HANDLE file; + HANDLE mapping; +}; +#elif defined __ANDROID__ || defined __OHOS__ || defined __linux__ || __APPLE__ +class NCNN_EXPORT MappedFile +{ +public: + MappedFile() { ptr = 0; _size = 0; fd = -1; } + ~MappedFile() { close(); } + int open(const char* path) + { + close(); + + fd = ::open(path, O_RDONLY); + if (fd < 0) return -1; + + struct stat st; + if (fstat(fd, &st) < 0) { close(); return -1; } + + _size = (size_t)st.st_size; + if (_size == 0) { close(); return -1; } + + ptr = mmap(NULL, _size, PROT_READ, MAP_PRIVATE, fd, 0); + if (ptr == MAP_FAILED) { close(); return -1; } + return 0; + } + void close() + { + if (ptr && ptr != MAP_FAILED) { munmap(ptr, _size); } + ptr = 0; + if (fd >= 0) { ::close(fd); fd = -1; } + _size = 0; + } + const void* mapped_ptr() const { return ptr; } + size_t size() const { return _size; } +private: + void* ptr; + size_t _size; + int fd; +}; +#else // defined _WIN32 || __ANDROID__ || defined __OHOS__ || defined __linux__ || __APPLE__ +class NCNN_EXPORT MappedFile +{ +public: + MappedFile() {} + ~MappedFile() {} + int open(const char* /*path*/) { return -1; } + void close() {} + const void* mapped_ptr() const { return 0; } + size_t size() const { return 0; } +}; +#endif // defined _WIN32 || __ANDROID__ || defined __OHOS__ || defined __linux__ || __APPLE__ + +static inline void swap_endianness_16(void* x) +{ + unsigned char* xx = (unsigned char*)x; + unsigned char x0 = xx[0]; + unsigned char x1 = xx[1]; + xx[0] = x1; + xx[1] = x0; +} + +static inline void swap_endianness_32(void* x) +{ + unsigned char* xx = (unsigned char*)x; + unsigned char x0 = xx[0]; + unsigned char x1 = xx[1]; + unsigned char x2 = xx[2]; + unsigned char x3 = xx[3]; + xx[0] = x3; + xx[1] = x2; + xx[2] = x1; + xx[3] = x0; +} + +} // namespace ncnn + +#if NCNN_SIMPLESTL +#include "simplestl.h" +#else +#include +#include +#include +#include +#include +#endif + +// simplemath +#if NCNN_SIMPLEMATH +#include "simplemath.h" +#else +#include +#include +#endif + +#if NCNN_VULKAN +#if NCNN_SIMPLEVK +#include "simplevk.h" +#else +#include +#endif +#include "vulkan_header_fix.h" +#endif // NCNN_VULKAN + +#endif // __cplusplus + +#if NCNN_STDIO +#if NCNN_PLATFORM_API && __ANDROID_API__ >= 8 +#include +#define NCNN_LOGE(...) do { \ + fprintf(stderr, ##__VA_ARGS__); fprintf(stderr, "\n"); \ + __android_log_print(ANDROID_LOG_WARN, "ncnn", ##__VA_ARGS__); } while(0) +#else // NCNN_PLATFORM_API && __ANDROID_API__ >= 8 +#include +#define NCNN_LOGE(...) do { \ + fprintf(stderr, ##__VA_ARGS__); fprintf(stderr, "\n"); } while(0) +#endif // NCNN_PLATFORM_API && __ANDROID_API__ >= 8 +#else +#define NCNN_LOGE(...) +#endif + + +#if NCNN_FORCE_INLINE +#ifdef _MSC_VER + #define NCNN_FORCEINLINE __forceinline +#elif defined(__GNUC__) + #define NCNN_FORCEINLINE inline __attribute__((__always_inline__)) +#elif defined(__CLANG__) + #if __has_attribute(__always_inline__) + #define NCNN_FORCEINLINE inline __attribute__((__always_inline__)) + #else + #define NCNN_FORCEINLINE inline + #endif +#else + #define NCNN_FORCEINLINE inline +#endif +#else + #define NCNN_FORCEINLINE inline +#endif + +#endif // NCNN_PLATFORM_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/simplemath.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/simplemath.h new file mode 100644 index 0000000..8c5fb8c --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/simplemath.h @@ -0,0 +1,106 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_SIMPLEMATH_H +#define NCNN_SIMPLEMATH_H + +#include "platform.h" + +#if NCNN_SIMPLEMATH + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef INFINITY +#define INFINITY (1.0f / 0.0f) +#endif + +/* +* ==================================================== +* discrete functions +* ==================================================== +*/ +NCNN_EXPORT float fabs(float); +NCNN_EXPORT float fabsf(float); +NCNN_EXPORT float fmod(float, float); +NCNN_EXPORT float floor(float); +NCNN_EXPORT float floorf(float); +NCNN_EXPORT float round(float); +NCNN_EXPORT float roundf(float); +NCNN_EXPORT float ceil(float); +NCNN_EXPORT float ceilf(float); +NCNN_EXPORT float fmaxf(float, float); +NCNN_EXPORT float truncf(float); +NCNN_EXPORT float frac(float); +NCNN_EXPORT float fmodf(float, float); +NCNN_EXPORT float remainderf(float, float); +/* +* ==================================================== +* trigonometric functions +* ==================================================== +*/ +NCNN_EXPORT float sinf(float); +NCNN_EXPORT float cosf(float); +NCNN_EXPORT float tanf(float); +NCNN_EXPORT float asinf(float); +NCNN_EXPORT float acosf(float); +NCNN_EXPORT float atanf(float); +NCNN_EXPORT float atan2f(float, float); +NCNN_EXPORT float sinhf(float); +NCNN_EXPORT float coshf(float); +NCNN_EXPORT float tanhf(float); +NCNN_EXPORT float asinhf(float); +NCNN_EXPORT float acoshf(float); +NCNN_EXPORT float atanhf(float); + +/* +* ==================================================== +* power functions +* ==================================================== +*/ +NCNN_EXPORT float sqrtf(float); +NCNN_EXPORT float sqrt(float); +NCNN_EXPORT float powf(float, float); + +/* +* ==================================================== +* exponential and logarithm functions +* ==================================================== +*/ +NCNN_EXPORT float expf(float); +NCNN_EXPORT float expm1f(float); +NCNN_EXPORT float frexp(float, int*); +NCNN_EXPORT float logf(float); +NCNN_EXPORT float log(float); +NCNN_EXPORT float log10f(float); +NCNN_EXPORT float log1pf(float); + +/* +* ==================================================== +* probability functions +* ==================================================== +*/ +NCNN_EXPORT float erf(float); +NCNN_EXPORT float erff(float); +NCNN_EXPORT float erfcf(float); + +/* +* ==================================================== +* other functions +* ==================================================== +*/ +NCNN_EXPORT int msb(unsigned int); +NCNN_EXPORT float fmaf(float, float, float); +NCNN_EXPORT float copysignf(float, float); +NCNN_EXPORT void fesetround(int); +NCNN_EXPORT int fegetround(); +NCNN_EXPORT float nearbyintf(float); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // NCNN_SIMPLEMATH + +#endif // NCNN_SIMPLEMATH_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/simpleocv.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/simpleocv.h new file mode 100644 index 0000000..650e520 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/simpleocv.h @@ -0,0 +1,492 @@ +// Copyright 2017 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_SIMPLEOCV_H +#define NCNN_SIMPLEOCV_H + +#include "platform.h" + +#if NCNN_SIMPLEOCV + +#include +#include +#include "allocator.h" +#include "mat.h" + +#if defined(_MSC_VER) || defined(__GNUC__) +#pragma push_macro("min") +#pragma push_macro("max") +#undef min +#undef max +#endif + +#ifndef NCNN_XADD +using ncnn::NCNN_XADD; +#endif + +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; + +enum +{ + CV_LOAD_IMAGE_UNCHANGED = -1, + CV_LOAD_IMAGE_GRAYSCALE = 0, + CV_LOAD_IMAGE_COLOR = 1, +}; + +enum +{ + CV_IMWRITE_JPEG_QUALITY = 1 +}; + +// minimal opencv style data structure implementation +namespace cv { + +template +static inline _Tp saturate_cast(int v) +{ + return _Tp(v); +} +template<> +inline uchar saturate_cast(int v) +{ + return (uchar)((unsigned)v <= UCHAR_MAX ? v : v > 0 ? UCHAR_MAX : 0); +} + +template +struct Scalar_ +{ + Scalar_() + { + v[0] = 0; + v[1] = 0; + v[2] = 0; + v[3] = 0; + } + Scalar_(_Tp _v0) + { + v[0] = _v0; + v[1] = 0; + v[2] = 0; + v[3] = 0; + } + Scalar_(_Tp _v0, _Tp _v1, _Tp _v2) + { + v[0] = _v0; + v[1] = _v1; + v[2] = _v2; + v[3] = 0; + } + Scalar_(_Tp _v0, _Tp _v1, _Tp _v2, _Tp _v3) + { + v[0] = _v0; + v[1] = _v1; + v[2] = _v2; + v[3] = _v3; + } + + const _Tp operator[](const int i) const + { + return v[i]; + } + + _Tp operator[](const int i) + { + return v[i]; + } + + _Tp v[4]; +}; + +typedef Scalar_ Scalar; + +template +struct Point_ +{ + Point_() + : x(0), y(0) + { + } + Point_(_Tp _x, _Tp _y) + : x(_x), y(_y) + { + } + + template + operator Point_<_Tp2>() const + { + return Point_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y)); + } + + _Tp x; + _Tp y; +}; + +typedef Point_ Point; +typedef Point_ Point2f; + +template +struct Size_ +{ + Size_() + : width(0), height(0) + { + } + Size_(_Tp _w, _Tp _h) + : width(_w), height(_h) + { + } + + template + operator Size_<_Tp2>() const + { + return Size_<_Tp2>(saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height)); + } + + _Tp width; + _Tp height; +}; + +typedef Size_ Size; +typedef Size_ Size2f; + +template +struct Rect_ +{ + Rect_() + : x(0), y(0), width(0), height(0) + { + } + Rect_(_Tp _x, _Tp _y, _Tp _w, _Tp _h) + : x(_x), y(_y), width(_w), height(_h) + { + } + Rect_(Point_<_Tp> _p, Size_<_Tp> _size) + : x(_p.x), y(_p.y), width(_size.width), height(_size.height) + { + } + + template + operator Rect_<_Tp2>() const + { + return Rect_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y), saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height)); + } + + _Tp x; + _Tp y; + _Tp width; + _Tp height; + + // area + _Tp area() const + { + return width * height; + } +}; + +template +static inline Rect_<_Tp>& operator&=(Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + _Tp x1 = std::max(a.x, b.x), y1 = std::max(a.y, b.y); + a.width = std::min(a.x + a.width, b.x + b.width) - x1; + a.height = std::min(a.y + a.height, b.y + b.height) - y1; + a.x = x1; + a.y = y1; + if (a.width <= 0 || a.height <= 0) + a = Rect_<_Tp>(); + return a; +} + +template +static inline Rect_<_Tp>& operator|=(Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + _Tp x1 = std::min(a.x, b.x), y1 = std::min(a.y, b.y); + a.width = std::max(a.x + a.width, b.x + b.width) - x1; + a.height = std::max(a.y + a.height, b.y + b.height) - y1; + a.x = x1; + a.y = y1; + return a; +} + +template +static inline Rect_<_Tp> operator&(const Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + Rect_<_Tp> c = a; + return c &= b; +} + +template +static inline Rect_<_Tp> operator|(const Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + Rect_<_Tp> c = a; + return c |= b; +} + +typedef Rect_ Rect; +typedef Rect_ Rect2f; + +#define CV_8UC1 1 +#define CV_8UC3 3 +#define CV_8UC4 4 +#define CV_32FC1 4 + +struct NCNN_EXPORT Mat +{ + Mat() + : data(0), refcount(0), rows(0), cols(0), c(0) + { + } + + Mat(int _rows, int _cols, int flags) + : data(0), refcount(0) + { + create(_rows, _cols, flags); + } + + // copy + Mat(const Mat& m) + : data(m.data), refcount(m.refcount) + { + if (refcount) + NCNN_XADD(refcount, 1); + + rows = m.rows; + cols = m.cols; + c = m.c; + } + + Mat(int _rows, int _cols, int flags, void* _data) + : data((unsigned char*)_data), refcount(0) + { + rows = _rows; + cols = _cols; + c = flags; + } + + ~Mat() + { + release(); + } + + // assign + Mat& operator=(const Mat& m) + { + if (this == &m) + return *this; + + if (m.refcount) + NCNN_XADD(m.refcount, 1); + + release(); + + data = m.data; + refcount = m.refcount; + + rows = m.rows; + cols = m.cols; + c = m.c; + + return *this; + } + + Mat& operator=(const Scalar& s) + { + if (total() > 0) + { + uchar* p = data; + for (int i = 0; i < cols * rows; i++) + { + for (int j = 0; j < c; j++) + { + *p++ = s[j]; + } + } + } + + return *this; + } + + void create(int _rows, int _cols, int flags) + { + release(); + + rows = _rows; + cols = _cols; + c = flags; + + if (total() > 0) + { + // refcount address must be aligned, so we expand totalsize here + size_t totalsize = (total() + 3) >> 2 << 2; + data = (uchar*)ncnn::fastMalloc(totalsize + (int)sizeof(*refcount)); + refcount = (int*)(((uchar*)data) + totalsize); + *refcount = 1; + } + } + + void release() + { + if (refcount && NCNN_XADD(refcount, -1) == 1) + ncnn::fastFree(data); + + data = 0; + + rows = 0; + cols = 0; + c = 0; + + refcount = 0; + } + + Mat clone() const + { + if (empty()) + return Mat(); + + Mat m(rows, cols, c); + + if (total() > 0) + { + memcpy(m.data, data, total()); + } + + return m; + } + + bool empty() const + { + return data == 0 || total() == 0; + } + + int channels() const + { + return c; + } + + int type() const + { + return c; + } + + size_t total() const + { + return cols * rows * c; + } + + const uchar* ptr(int y) const + { + return data + y * cols * c; + } + + uchar* ptr(int y) + { + return data + y * cols * c; + } + + template + const _Tp* ptr(int y) const + { + return (const _Tp*)(data + y * cols * c); + } + + template + _Tp* ptr(int y) + { + return (_Tp*)(data + y * cols * c); + } + + // roi + Mat operator()(const Rect& roi) const + { + if (empty()) + return Mat(); + + Mat m(roi.height, roi.width, c); + + int sy = roi.y; + for (int y = 0; y < roi.height; y++) + { + const uchar* sptr = ptr(sy) + roi.x * c; + uchar* dptr = m.ptr(y); + memcpy(dptr, sptr, roi.width * c); + sy++; + } + + return m; + } + + uchar* data; + + // pointer to the reference counter; + // when points to user-allocated data, the pointer is NULL + int* refcount; + + int rows; + int cols; + + int c; +}; + +enum ImreadModes +{ + IMREAD_UNCHANGED = -1, + IMREAD_GRAYSCALE = 0, + IMREAD_COLOR = 1 +}; + +NCNN_EXPORT Mat imread(const std::string& path, int flags = IMREAD_COLOR); + +NCNN_EXPORT Mat imdecode(const std::vector& buf, int flags = IMREAD_COLOR); + +enum ImwriteFlags +{ + IMWRITE_JPEG_QUALITY = 1 +}; + +NCNN_EXPORT bool imwrite(const std::string& path, const Mat& m, const std::vector& params = std::vector()); + +NCNN_EXPORT void imshow(const std::string& name, const Mat& m); + +NCNN_EXPORT int waitKey(int delay = 0); + +#if NCNN_PIXEL +NCNN_EXPORT void resize(const Mat& src, Mat& dst, const Size& size, float sw = 0.f, float sh = 0.f, int flags = 0); +#endif // NCNN_PIXEL + +#if NCNN_PIXEL_DRAWING + +enum +{ + FILLED = -1 +}; + +NCNN_EXPORT void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness = 1); + +NCNN_EXPORT void rectangle(Mat& img, Rect rec, const Scalar& color, int thickness = 1); + +NCNN_EXPORT void circle(Mat& img, Point center, int radius, const Scalar& color, int thickness = 1); + +NCNN_EXPORT void line(Mat& img, Point p0, Point p1, const Scalar& color, int thickness = 1); + +enum +{ + FONT_HERSHEY_SIMPLEX = 0 +}; + +NCNN_EXPORT void putText(Mat& img, const std::string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness = 1); + +NCNN_EXPORT Size getTextSize(const std::string& text, int fontFace, double fontScale, int thickness, int* baseLine); + +#endif // NCNN_PIXEL_DRAWING + +} // namespace cv + +#if defined(_MSC_VER) || defined(__GNUC__) +#pragma pop_macro("min") +#pragma pop_macro("max") +#endif + +#endif // NCNN_SIMPLEOCV + +#endif // NCNN_SIMPLEOCV_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/simpleomp.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/simpleomp.h new file mode 100644 index 0000000..0f132f7 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/simpleomp.h @@ -0,0 +1,42 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_SIMPLEOMP_H +#define NCNN_SIMPLEOMP_H + +#include "platform.h" + +#if NCNN_SIMPLEOMP + +#include + +// This minimal openmp runtime implementation only supports the llvm openmp abi +// and only supports #pragma omp parallel for num_threads(X) + +#ifdef __cplusplus +extern "C" { +#endif + +NCNN_EXPORT int omp_get_max_threads(); + +NCNN_EXPORT void omp_set_num_threads(int num_threads); + +NCNN_EXPORT int omp_get_dynamic(); + +NCNN_EXPORT void omp_set_dynamic(int dynamic); + +NCNN_EXPORT int omp_get_num_threads(); + +NCNN_EXPORT int omp_get_thread_num(); + +NCNN_EXPORT int kmp_get_blocktime(); + +NCNN_EXPORT void kmp_set_blocktime(int blocktime); + +#ifdef __cplusplus +} +#endif + +#endif // NCNN_SIMPLEOMP + +#endif // NCNN_SIMPLEOMP_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/simplestl.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/simplestl.h new file mode 100644 index 0000000..334d75a --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/simplestl.h @@ -0,0 +1,598 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_SIMPLESTL_H +#define NCNN_SIMPLESTL_H + +#include +#include +#include + +#if !NCNN_SIMPLESTL + +#include + +#else + +// allocation functions +NCNN_EXPORT void* operator new(size_t size); +NCNN_EXPORT void* operator new[](size_t size); +// placement allocation functions +NCNN_EXPORT void* operator new(size_t size, void* ptr); +NCNN_EXPORT void* operator new[](size_t size, void* ptr); +// deallocation functions +NCNN_EXPORT void operator delete(void* ptr); +NCNN_EXPORT void operator delete[](void* ptr); +// deallocation functions since c++14 +#if __cplusplus >= 201402L +NCNN_EXPORT void operator delete(void* ptr, size_t sz); +NCNN_EXPORT void operator delete[](void* ptr, size_t sz); +#endif +// placement deallocation functions +NCNN_EXPORT void operator delete(void* ptr, void* voidptr2); +NCNN_EXPORT void operator delete[](void* ptr, void* voidptr2); + +#endif + +// minimal stl data structure implementation +namespace std { + +template +const T& max(const T& a, const T& b) +{ + return (a < b) ? b : a; +} + +template +const T& min(const T& a, const T& b) +{ + return (a > b) ? b : a; +} + +template +void swap(T& a, T& b) +{ + T temp(a); + a = b; + b = temp; +} + +template +struct pair +{ + pair() + : first(), second() + { + } + pair(const T1& t1, const T2& t2) + : first(t1), second(t2) + { + } + + T1 first; + T2 second; +}; + +template +bool operator==(const pair& x, const pair& y) +{ + return (x.first == y.first && x.second == y.second); +} +template +bool operator<(const pair& x, const pair& y) +{ + return x.first < y.first || (!(y.first < x.first) && x.second < y.second); +} +template +bool operator!=(const pair& x, const pair& y) +{ + return !(x == y); +} +template +bool operator>(const pair& x, const pair& y) +{ + return y < x; +} +template +bool operator<=(const pair& x, const pair& y) +{ + return !(y < x); +} +template +bool operator>=(const pair& x, const pair& y) +{ + return !(x < y); +} + +template +pair make_pair(const T1& t1, const T2& t2) +{ + return pair(t1, t2); +} + +template +struct node +{ + node* prev_; + node* next_; + T data_; + + node() + : prev_(0), next_(0), data_() + { + } + node(const T& t) + : prev_(0), next_(0), data_(t) + { + } +}; + +template +struct iter_list +{ + iter_list() + : curr_(0) + { + } + iter_list(node* n) + : curr_(n) + { + } + iter_list(const iter_list& i) + : curr_(i.curr_) + { + } + ~iter_list() + { + } + + iter_list& operator=(const iter_list& i) + { + curr_ = i.curr_; + return *this; + } + + T& operator*() + { + return curr_->data_; + } + T* operator->() + { + return &(curr_->data_); + } + + bool operator==(const iter_list& i) + { + return curr_ == i.curr_; + } + bool operator!=(const iter_list& i) + { + return curr_ != i.curr_; + } + + iter_list& operator++() + { + curr_ = curr_->next_; + return *this; + } + iter_list& operator--() + { + curr_ = curr_->prev_; + return *this; + } + + node* curr_; +}; + +template +struct list +{ + typedef iter_list iterator; + + list() + { + head_ = new node(); + tail_ = head_; + count_ = 0; + } + ~list() + { + clear(); + delete head_; + } + list(const list& l) + { + head_ = new node(); + tail_ = head_; + count_ = 0; + + for (iter_list i = l.begin(); i != l.end(); ++i) + { + push_back(*i); + } + } + + list& operator=(const list& l) + { + if (this == &l) + { + return *this; + } + clear(); + + for (iter_list i = l.begin(); i != l.end(); ++i) + { + push_back(*i); + } + return *this; + } + + void clear() + { + while (count_ > 0) + { + pop_front(); + } + } + + void pop_front() + { + if (count_ > 0) + { + head_ = head_->next_; + delete head_->prev_; + head_->prev_ = 0; + --count_; + } + } + + size_t size() const + { + return count_; + } + iter_list begin() const + { + return iter_list(head_); + } + iter_list end() const + { + return iter_list(tail_); + } + bool empty() const + { + return count_ == 0; + } + + void push_back(const T& t) + { + if (count_ == 0) + { + head_ = new node(t); + head_->prev_ = 0; + head_->next_ = tail_; + tail_->prev_ = head_; + count_ = 1; + } + else + { + node* temp = new node(t); + temp->prev_ = tail_->prev_; + temp->next_ = tail_; + tail_->prev_->next_ = temp; + tail_->prev_ = temp; + ++count_; + } + } + + iter_list erase(iter_list pos) + { + if (pos != end()) + { + node* temp = pos.curr_; + if (temp == head_) + { + ++pos; + temp->next_->prev_ = 0; + head_ = temp->next_; + } + else + { + --pos; + temp->next_->prev_ = temp->prev_; + temp->prev_->next_ = temp->next_; + ++pos; + } + delete temp; + --count_; + } + return pos; + } + +protected: + node* head_; + node* tail_; + size_t count_; +}; + +template +struct greater +{ + bool operator()(const T& x, const T& y) const + { + return (x > y); + } +}; + +template +struct less +{ + bool operator()(const T& x, const T& y) const + { + return (x < y); + } +}; + +template +void partial_sort(RandomAccessIter first, RandomAccessIter middle, RandomAccessIter last, Compare comp) +{ + // [TODO] heap sort should be used here, but we simply use bubble sort now + for (RandomAccessIter i = first; i < middle; ++i) + { + // bubble sort + for (RandomAccessIter j = last - 1; j > first; --j) + { + if (comp(*j, *(j - 1))) + { + swap(*j, *(j - 1)); + } + } + } +} + +template +struct vector +{ + vector() + : data_(0), size_(0), capacity_(0) + { + } + vector(const size_t new_size, const T& value = T()) + : data_(0), size_(0), capacity_(0) + { + resize(new_size, value); + } + ~vector() + { + clear(); + } + vector(const vector& v) + : data_(0), size_(0), capacity_(0) + { + resize(v.size()); + for (size_t i = 0; i < size_; i++) + { + data_[i] = v.data_[i]; + } + } + + vector& operator=(const vector& v) + { + if (this == &v) + { + return *this; + } + resize(0); + resize(v.size()); + for (size_t i = 0; i < size_; i++) + { + data_[i] = v.data_[i]; + } + return *this; + } + + void resize(const size_t new_size, const T& value = T()) + { + try_alloc(new_size); + if (new_size > size_) + { + for (size_t i = size_; i < new_size; i++) + { + new (&data_[i]) T(value); + } + } + else if (new_size < size_) + { + for (size_t i = new_size; i < size_; i++) + { + data_[i].~T(); + } + } + size_ = new_size; + } + + void clear() + { + for (size_t i = 0; i < size_; i++) + { + data_[i].~T(); + } + delete[](char*) data_; + data_ = 0; + size_ = 0; + capacity_ = 0; + } + + T* data() const + { + return data_; + } + size_t size() const + { + return size_; + } + T& operator[](size_t i) const + { + return data_[i]; + } + T* begin() const + { + return &data_[0]; + } + T* end() const + { + return &data_[size_]; + } + bool empty() const + { + return size_ == 0; + } + + void push_back(const T& t) + { + try_alloc(size_ + 1); + new (&data_[size_]) T(t); + size_++; + } + + void insert(T* pos, T* b, T* e) + { + vector* v = 0; + if (b >= begin() && b < end()) + { + //the same vector + v = new vector(*this); + b = v->begin() + (b - begin()); + e = v->begin() + (e - begin()); + } + size_t diff = pos - begin(); + try_alloc(size_ + (e - b)); + pos = begin() + diff; + memmove(pos + (e - b), pos, (end() - pos) * sizeof(T)); + size_t len = e - b; + size_ += len; + for (size_t i = 0; i < len; i++) + { + *pos = *b; + pos++; + b++; + } + delete v; + } + + T* erase(T* pos) + { + pos->~T(); + memmove(pos, pos + 1, (end() - pos - 1) * sizeof(T)); + size_--; + return pos; + } + + void pop_back() + { + if (size_ > 0) + { + data_[size_ - 1].~T(); + size_--; + } + } + + T& back() const + { + return data_[size_ - 1]; + } + +protected: + T* data_; + size_t size_; + size_t capacity_; + void try_alloc(size_t new_size) + { + if (new_size * 3 / 2 > capacity_ / 2) + { + capacity_ = new_size * 2; + T* new_data = (T*)new char[capacity_ * sizeof(T)]; + memset(static_cast(new_data), 0, capacity_ * sizeof(T)); + if (data_) + { + memmove(new_data, data_, sizeof(T) * size_); + delete[](char*) data_; + } + data_ = new_data; + } + } +}; + +template +struct stack : protected vector +{ + void push(const T& t) + { + vector::push_back(t); + } + + void pop() + { + vector::pop_back(); + } + + T& top() + { + return vector::back(); + } + + bool empty() const + { + return vector::empty(); + } + + size_t size() const + { + return vector::size(); + } + + void clear() + { + vector::clear(); + } +}; + +struct NCNN_EXPORT string : public vector +{ + string() + { + } + string(const char* str) + { + size_t len = strlen(str); + resize(len); + memcpy(data_, str, len); + } + const char* c_str() const + { + return (const char*)data_; + } + bool operator==(const string& str2) const + { + return size_ == str2.size_ && strncmp(data_, str2.data_, size_) == 0; + } + bool operator!=(const string& str2) const + { + return size_ != str2.size_ || strncmp(data_, str2.data_, size_) != 0; + } + string& operator+=(const string& str1) + { + insert(end(), str1.begin(), str1.end()); + return *this; + } +}; + +inline string operator+(const string& str1, const string& str2) +{ + string str(str1); + str.insert(str.end(), str2.begin(), str2.end()); + return str; +} + +} // namespace std + +#endif // NCNN_SIMPLESTL_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/simplevk.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/simplevk.h new file mode 100644 index 0000000..c2c7060 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/simplevk.h @@ -0,0 +1,2196 @@ +// Copyright 2023 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_SIMPLEVK_H +#define NCNN_SIMPLEVK_H + +#include "platform.h" + +#if NCNN_VULKAN +#if NCNN_SIMPLEVK + +#define VK_VERSION_1_0 1 + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/* +*************************************************************************************************** +* Platform-specific directives and type declarations +*************************************************************************************************** +*/ + +/* Platform-specific calling convention macros. + * + * Platforms should define these so that Vulkan clients call Vulkan commands + * with the same calling conventions that the Vulkan implementation expects. + * + * VKAPI_ATTR - Placed before the return type in function declarations. + * Useful for C++11 and GCC/Clang-style function attribute syntax. + * VKAPI_CALL - Placed after the return type in function declarations. + * Useful for MSVC-style calling convention syntax. + * VKAPI_PTR - Placed between the '(' and '*' in function pointer types. + * + * Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void); + * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void); + */ +#if defined(_WIN32) +// On Windows, Vulkan commands use the stdcall convention +#define VKAPI_ATTR +#define VKAPI_CALL __stdcall +#define VKAPI_PTR VKAPI_CALL +#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7 +#error "Vulkan isn't supported for the 'armeabi' NDK ABI" +#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE) +// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" +// calling convention, i.e. float parameters are passed in registers. This +// is true even if the rest of the application passes floats on the stack, +// as it does by default when compiling for the armeabi-v7a NDK ABI. +#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp"))) +#define VKAPI_CALL +#define VKAPI_PTR VKAPI_ATTR +#else +// On other platforms, use the default calling convention +#define VKAPI_ATTR +#define VKAPI_CALL +#define VKAPI_PTR +#endif + +#include + +#if !defined(VK_NO_STDINT_H) +#if defined(_MSC_VER) && (_MSC_VER < 1600) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include +#endif +#endif // !defined(VK_NO_STDINT_H) + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +#define VK_MAKE_VERSION(major, minor, patch) (((major) << 22) | ((minor) << 12) | (patch)) + +// Vulkan 1.0 version number +#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 + +#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) +#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) +#define VK_VERSION_PATCH(version) ((uint32_t)(version)&0xfff) +// Version of this file +#define VK_HEADER_VERSION 0 + +#define VK_NULL_HANDLE 0 + +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; + +#if !defined(VK_DEFINE_NON_DISPATCHABLE_HANDLE) +#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T* object; +#else +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; +#endif +#endif + +typedef uint32_t VkBool32; +typedef uint64_t VkDeviceSize; +typedef uint32_t VkFlags; +typedef uint32_t VkSampleMask; + +VK_DEFINE_HANDLE(VkCommandBuffer) +VK_DEFINE_HANDLE(VkDevice) +VK_DEFINE_HANDLE(VkInstance) +VK_DEFINE_HANDLE(VkPhysicalDevice) +VK_DEFINE_HANDLE(VkQueue) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) +#define VK_UUID_SIZE 16U +#define VK_ATTACHMENT_UNUSED (~0U) +#define VK_FALSE 0U +#define VK_LOD_CLAMP_NONE 1000.0F +#define VK_QUEUE_FAMILY_IGNORED (~0U) +#define VK_REMAINING_ARRAY_LAYERS (~0U) +#define VK_REMAINING_MIP_LEVELS (~0U) +#define VK_SUBPASS_EXTERNAL (~0U) +#define VK_TRUE 1U +#define VK_WHOLE_SIZE (~0ULL) +#define VK_MAX_MEMORY_TYPES 32U +#define VK_MAX_MEMORY_HEAPS 16U +#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256U +#define VK_MAX_EXTENSION_NAME_SIZE 256U +#define VK_MAX_DESCRIPTION_SIZE 256U + +typedef enum VkPipelineCacheHeaderVersion +{ + VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, + VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF +} VkPipelineCacheHeaderVersion; + +typedef enum VkResult +{ + VK_SUCCESS = 0, + VK_NOT_READY = 1, + VK_TIMEOUT = 2, + VK_EVENT_SET = 3, + VK_EVENT_RESET = 4, + VK_INCOMPLETE = 5, + VK_ERROR_OUT_OF_HOST_MEMORY = -1, + VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, + VK_ERROR_INITIALIZATION_FAILED = -3, + VK_ERROR_DEVICE_LOST = -4, + VK_ERROR_MEMORY_MAP_FAILED = -5, + VK_ERROR_LAYER_NOT_PRESENT = -6, + VK_ERROR_EXTENSION_NOT_PRESENT = -7, + VK_ERROR_FEATURE_NOT_PRESENT = -8, + VK_ERROR_INCOMPATIBLE_DRIVER = -9, + VK_ERROR_TOO_MANY_OBJECTS = -10, + VK_ERROR_FORMAT_NOT_SUPPORTED = -11, + VK_ERROR_FRAGMENTED_POOL = -12, + VK_ERROR_SURFACE_LOST_KHR = -1000000000, + VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, + VK_SUBOPTIMAL_KHR = 1000001003, + VK_ERROR_OUT_OF_DATE_KHR = -1000001004, + VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, + VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, + VK_ERROR_INVALID_SHADER_NV = -1000012000, + VK_ERROR_OUT_OF_POOL_MEMORY_KHR = -1000069000, + VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = -1000072003, + VK_RESULT_MAX_ENUM = 0x7FFFFFFF +} VkResult; + +typedef enum VkStructureType +{ + VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, + VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, + VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, + VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, + VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, + VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, + VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, + VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, + VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, + VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, + VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, + VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, + VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, + VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, + VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, + VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, + VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, + VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, + VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, + VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, + VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, + VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, + VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, + VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, + VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, + VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, + VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, + VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, + VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, + VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, + VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, + VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, + VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, + VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, + VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, + VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, + VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000, + VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001, + VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR = 1000003000, + VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, + VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, + VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, + VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, + VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, + VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, + VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, + VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, + VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, + VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, + VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkStructureType; + +typedef enum VkSystemAllocationScope +{ + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, + VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, + VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4, + VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7FFFFFFF +} VkSystemAllocationScope; + +typedef enum VkInternalAllocationType +{ + VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0, + VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkInternalAllocationType; + +typedef enum VkFormat +{ + VK_FORMAT_UNDEFINED = 0, + VK_FORMAT_R4G4_UNORM_PACK8 = 1, + VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, + VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, + VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, + VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, + VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, + VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, + VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, + VK_FORMAT_R8_UNORM = 9, + VK_FORMAT_R8_SNORM = 10, + VK_FORMAT_R8_USCALED = 11, + VK_FORMAT_R8_SSCALED = 12, + VK_FORMAT_R8_UINT = 13, + VK_FORMAT_R8_SINT = 14, + VK_FORMAT_R8_SRGB = 15, + VK_FORMAT_R8G8_UNORM = 16, + VK_FORMAT_R8G8_SNORM = 17, + VK_FORMAT_R8G8_USCALED = 18, + VK_FORMAT_R8G8_SSCALED = 19, + VK_FORMAT_R8G8_UINT = 20, + VK_FORMAT_R8G8_SINT = 21, + VK_FORMAT_R8G8_SRGB = 22, + VK_FORMAT_R8G8B8_UNORM = 23, + VK_FORMAT_R8G8B8_SNORM = 24, + VK_FORMAT_R8G8B8_USCALED = 25, + VK_FORMAT_R8G8B8_SSCALED = 26, + VK_FORMAT_R8G8B8_UINT = 27, + VK_FORMAT_R8G8B8_SINT = 28, + VK_FORMAT_R8G8B8_SRGB = 29, + VK_FORMAT_B8G8R8_UNORM = 30, + VK_FORMAT_B8G8R8_SNORM = 31, + VK_FORMAT_B8G8R8_USCALED = 32, + VK_FORMAT_B8G8R8_SSCALED = 33, + VK_FORMAT_B8G8R8_UINT = 34, + VK_FORMAT_B8G8R8_SINT = 35, + VK_FORMAT_B8G8R8_SRGB = 36, + VK_FORMAT_R8G8B8A8_UNORM = 37, + VK_FORMAT_R8G8B8A8_SNORM = 38, + VK_FORMAT_R8G8B8A8_USCALED = 39, + VK_FORMAT_R8G8B8A8_SSCALED = 40, + VK_FORMAT_R8G8B8A8_UINT = 41, + VK_FORMAT_R8G8B8A8_SINT = 42, + VK_FORMAT_R8G8B8A8_SRGB = 43, + VK_FORMAT_B8G8R8A8_UNORM = 44, + VK_FORMAT_B8G8R8A8_SNORM = 45, + VK_FORMAT_B8G8R8A8_USCALED = 46, + VK_FORMAT_B8G8R8A8_SSCALED = 47, + VK_FORMAT_B8G8R8A8_UINT = 48, + VK_FORMAT_B8G8R8A8_SINT = 49, + VK_FORMAT_B8G8R8A8_SRGB = 50, + VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, + VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, + VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, + VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, + VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, + VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, + VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, + VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, + VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, + VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, + VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, + VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, + VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, + VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, + VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, + VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, + VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, + VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, + VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, + VK_FORMAT_R16_UNORM = 70, + VK_FORMAT_R16_SNORM = 71, + VK_FORMAT_R16_USCALED = 72, + VK_FORMAT_R16_SSCALED = 73, + VK_FORMAT_R16_UINT = 74, + VK_FORMAT_R16_SINT = 75, + VK_FORMAT_R16_SFLOAT = 76, + VK_FORMAT_R16G16_UNORM = 77, + VK_FORMAT_R16G16_SNORM = 78, + VK_FORMAT_R16G16_USCALED = 79, + VK_FORMAT_R16G16_SSCALED = 80, + VK_FORMAT_R16G16_UINT = 81, + VK_FORMAT_R16G16_SINT = 82, + VK_FORMAT_R16G16_SFLOAT = 83, + VK_FORMAT_R16G16B16_UNORM = 84, + VK_FORMAT_R16G16B16_SNORM = 85, + VK_FORMAT_R16G16B16_USCALED = 86, + VK_FORMAT_R16G16B16_SSCALED = 87, + VK_FORMAT_R16G16B16_UINT = 88, + VK_FORMAT_R16G16B16_SINT = 89, + VK_FORMAT_R16G16B16_SFLOAT = 90, + VK_FORMAT_R16G16B16A16_UNORM = 91, + VK_FORMAT_R16G16B16A16_SNORM = 92, + VK_FORMAT_R16G16B16A16_USCALED = 93, + VK_FORMAT_R16G16B16A16_SSCALED = 94, + VK_FORMAT_R16G16B16A16_UINT = 95, + VK_FORMAT_R16G16B16A16_SINT = 96, + VK_FORMAT_R16G16B16A16_SFLOAT = 97, + VK_FORMAT_R32_UINT = 98, + VK_FORMAT_R32_SINT = 99, + VK_FORMAT_R32_SFLOAT = 100, + VK_FORMAT_R32G32_UINT = 101, + VK_FORMAT_R32G32_SINT = 102, + VK_FORMAT_R32G32_SFLOAT = 103, + VK_FORMAT_R32G32B32_UINT = 104, + VK_FORMAT_R32G32B32_SINT = 105, + VK_FORMAT_R32G32B32_SFLOAT = 106, + VK_FORMAT_R32G32B32A32_UINT = 107, + VK_FORMAT_R32G32B32A32_SINT = 108, + VK_FORMAT_R32G32B32A32_SFLOAT = 109, + VK_FORMAT_R64_UINT = 110, + VK_FORMAT_R64_SINT = 111, + VK_FORMAT_R64_SFLOAT = 112, + VK_FORMAT_R64G64_UINT = 113, + VK_FORMAT_R64G64_SINT = 114, + VK_FORMAT_R64G64_SFLOAT = 115, + VK_FORMAT_R64G64B64_UINT = 116, + VK_FORMAT_R64G64B64_SINT = 117, + VK_FORMAT_R64G64B64_SFLOAT = 118, + VK_FORMAT_R64G64B64A64_UINT = 119, + VK_FORMAT_R64G64B64A64_SINT = 120, + VK_FORMAT_R64G64B64A64_SFLOAT = 121, + VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, + VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, + VK_FORMAT_D16_UNORM = 124, + VK_FORMAT_X8_D24_UNORM_PACK32 = 125, + VK_FORMAT_D32_SFLOAT = 126, + VK_FORMAT_S8_UINT = 127, + VK_FORMAT_D16_UNORM_S8_UINT = 128, + VK_FORMAT_D24_UNORM_S8_UINT = 129, + VK_FORMAT_D32_SFLOAT_S8_UINT = 130, + VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, + VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, + VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, + VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, + VK_FORMAT_BC2_UNORM_BLOCK = 135, + VK_FORMAT_BC2_SRGB_BLOCK = 136, + VK_FORMAT_BC3_UNORM_BLOCK = 137, + VK_FORMAT_BC3_SRGB_BLOCK = 138, + VK_FORMAT_BC4_UNORM_BLOCK = 139, + VK_FORMAT_BC4_SNORM_BLOCK = 140, + VK_FORMAT_BC5_UNORM_BLOCK = 141, + VK_FORMAT_BC5_SNORM_BLOCK = 142, + VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, + VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, + VK_FORMAT_BC7_UNORM_BLOCK = 145, + VK_FORMAT_BC7_SRGB_BLOCK = 146, + VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, + VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, + VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, + VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, + VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, + VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, + VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, + VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, + VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, + VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, + VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, + VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, + VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, + VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, + VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, + VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, + VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, + VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, + VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, + VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, + VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, + VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, + VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, + VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, + VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, + VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, + VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, + VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, + VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, + VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, + VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, + VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, + VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, + VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, + VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, + VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, + VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, + VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, + VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, + VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, + VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, + VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, + VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, + VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, + VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, + VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, + VK_FORMAT_G8B8G8R8_422_UNORM_KHR = 1000156000, + VK_FORMAT_B8G8R8G8_422_UNORM_KHR = 1000156001, + VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR = 1000156002, + VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR = 1000156003, + VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR = 1000156004, + VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR = 1000156005, + VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR = 1000156006, + VK_FORMAT_R10X6_UNORM_PACK16_KHR = 1000156007, + VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR = 1000156008, + VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR = 1000156009, + VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR = 1000156010, + VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR = 1000156011, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR = 1000156012, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR = 1000156013, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR = 1000156014, + VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR = 1000156015, + VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR = 1000156016, + VK_FORMAT_R12X4_UNORM_PACK16_KHR = 1000156017, + VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR = 1000156018, + VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR = 1000156019, + VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR = 1000156020, + VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR = 1000156021, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR = 1000156022, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR = 1000156023, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR = 1000156024, + VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR = 1000156025, + VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR = 1000156026, + VK_FORMAT_G16B16G16R16_422_UNORM_KHR = 1000156027, + VK_FORMAT_B16G16R16G16_422_UNORM_KHR = 1000156028, + VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR = 1000156029, + VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR = 1000156030, + VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR = 1000156031, + VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR = 1000156032, + VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR = 1000156033, + VK_FORMAT_MAX_ENUM = 0x7FFFFFFF +} VkFormat; + +typedef enum VkImageType +{ + VK_IMAGE_TYPE_1D = 0, + VK_IMAGE_TYPE_2D = 1, + VK_IMAGE_TYPE_3D = 2, + VK_IMAGE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkImageType; + +typedef enum VkImageTiling +{ + VK_IMAGE_TILING_OPTIMAL = 0, + VK_IMAGE_TILING_LINEAR = 1, + VK_IMAGE_TILING_MAX_ENUM = 0x7FFFFFFF +} VkImageTiling; + +typedef enum VkPhysicalDeviceType +{ + VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, + VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, + VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, + VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, + VK_PHYSICAL_DEVICE_TYPE_CPU = 4, + VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkPhysicalDeviceType; + +typedef enum VkQueryType +{ + VK_QUERY_TYPE_OCCLUSION = 0, + VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, + VK_QUERY_TYPE_TIMESTAMP = 2, + VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkQueryType; + +typedef enum VkSharingMode +{ + VK_SHARING_MODE_EXCLUSIVE = 0, + VK_SHARING_MODE_CONCURRENT = 1, + VK_SHARING_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSharingMode; + +typedef enum VkImageLayout +{ + VK_IMAGE_LAYOUT_UNDEFINED = 0, + VK_IMAGE_LAYOUT_GENERAL = 1, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, + VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, + VK_IMAGE_LAYOUT_PREINITIALIZED = 8, + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, + VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, + VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = 1000117000, + VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = 1000117001, + VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF +} VkImageLayout; + +typedef enum VkImageViewType +{ + VK_IMAGE_VIEW_TYPE_1D = 0, + VK_IMAGE_VIEW_TYPE_2D = 1, + VK_IMAGE_VIEW_TYPE_3D = 2, + VK_IMAGE_VIEW_TYPE_CUBE = 3, + VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, + VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, + VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6, + VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkImageViewType; + +typedef enum VkComponentSwizzle +{ + VK_COMPONENT_SWIZZLE_IDENTITY = 0, + VK_COMPONENT_SWIZZLE_ZERO = 1, + VK_COMPONENT_SWIZZLE_ONE = 2, + VK_COMPONENT_SWIZZLE_R = 3, + VK_COMPONENT_SWIZZLE_G = 4, + VK_COMPONENT_SWIZZLE_B = 5, + VK_COMPONENT_SWIZZLE_A = 6, + VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7FFFFFFF +} VkComponentSwizzle; + +typedef enum VkPrimitiveTopology +{ + VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, + VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10, + VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7FFFFFFF +} VkPrimitiveTopology; + +typedef enum VkPolygonMode +{ + VK_POLYGON_MODE_FILL = 0, + VK_POLYGON_MODE_LINE = 1, + VK_POLYGON_MODE_POINT = 2, + VK_POLYGON_MODE_FILL_RECTANGLE_NV = 1000153000, + VK_POLYGON_MODE_MAX_ENUM = 0x7FFFFFFF +} VkPolygonMode; + +typedef enum VkCompareOp +{ + VK_COMPARE_OP_NEVER = 0, + VK_COMPARE_OP_LESS = 1, + VK_COMPARE_OP_EQUAL = 2, + VK_COMPARE_OP_LESS_OR_EQUAL = 3, + VK_COMPARE_OP_GREATER = 4, + VK_COMPARE_OP_NOT_EQUAL = 5, + VK_COMPARE_OP_GREATER_OR_EQUAL = 6, + VK_COMPARE_OP_ALWAYS = 7, + VK_COMPARE_OP_MAX_ENUM = 0x7FFFFFFF +} VkCompareOp; + +typedef enum VkLogicOp +{ + VK_LOGIC_OP_CLEAR = 0, + VK_LOGIC_OP_AND = 1, + VK_LOGIC_OP_AND_REVERSE = 2, + VK_LOGIC_OP_COPY = 3, + VK_LOGIC_OP_AND_INVERTED = 4, + VK_LOGIC_OP_NO_OP = 5, + VK_LOGIC_OP_XOR = 6, + VK_LOGIC_OP_OR = 7, + VK_LOGIC_OP_NOR = 8, + VK_LOGIC_OP_EQUIVALENT = 9, + VK_LOGIC_OP_INVERT = 10, + VK_LOGIC_OP_OR_REVERSE = 11, + VK_LOGIC_OP_COPY_INVERTED = 12, + VK_LOGIC_OP_OR_INVERTED = 13, + VK_LOGIC_OP_NAND = 14, + VK_LOGIC_OP_SET = 15, + VK_LOGIC_OP_MAX_ENUM = 0x7FFFFFFF +} VkLogicOp; + +typedef enum VkFilter +{ + VK_FILTER_NEAREST = 0, + VK_FILTER_LINEAR = 1, + VK_FILTER_CUBIC_IMG = 1000015000, + VK_FILTER_MAX_ENUM = 0x7FFFFFFF +} VkFilter; + +typedef enum VkSamplerMipmapMode +{ + VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, + VK_SAMPLER_MIPMAP_MODE_LINEAR = 1, + VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerMipmapMode; + +typedef enum VkSamplerAddressMode +{ + VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, + VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3, + VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 4, + VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerAddressMode; + +typedef enum VkBorderColor +{ + VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, + VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, + VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, + VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, + VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, + VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5, + VK_BORDER_COLOR_MAX_ENUM = 0x7FFFFFFF +} VkBorderColor; + +typedef enum VkDescriptorType +{ + VK_DESCRIPTOR_TYPE_SAMPLER = 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, + VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, + VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, + VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, + VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, + VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10, + VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorType; + +typedef enum VkPipelineBindPoint +{ + VK_PIPELINE_BIND_POINT_GRAPHICS = 0, + VK_PIPELINE_BIND_POINT_COMPUTE = 1, + VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7FFFFFFF +} VkPipelineBindPoint; + +typedef enum VkCommandBufferLevel +{ + VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, + VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1, + VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferLevel; + +typedef enum VkIndexType +{ + VK_INDEX_TYPE_UINT16 = 0, + VK_INDEX_TYPE_UINT32 = 1, + VK_INDEX_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkIndexType; + +typedef enum VkObjectType +{ + VK_OBJECT_TYPE_UNKNOWN = 0, + VK_OBJECT_TYPE_INSTANCE = 1, + VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, + VK_OBJECT_TYPE_DEVICE = 3, + VK_OBJECT_TYPE_QUEUE = 4, + VK_OBJECT_TYPE_SEMAPHORE = 5, + VK_OBJECT_TYPE_COMMAND_BUFFER = 6, + VK_OBJECT_TYPE_FENCE = 7, + VK_OBJECT_TYPE_DEVICE_MEMORY = 8, + VK_OBJECT_TYPE_BUFFER = 9, + VK_OBJECT_TYPE_IMAGE = 10, + VK_OBJECT_TYPE_EVENT = 11, + VK_OBJECT_TYPE_QUERY_POOL = 12, + VK_OBJECT_TYPE_BUFFER_VIEW = 13, + VK_OBJECT_TYPE_IMAGE_VIEW = 14, + VK_OBJECT_TYPE_SHADER_MODULE = 15, + VK_OBJECT_TYPE_PIPELINE_CACHE = 16, + VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, + VK_OBJECT_TYPE_RENDER_PASS = 18, + VK_OBJECT_TYPE_PIPELINE = 19, + VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, + VK_OBJECT_TYPE_SAMPLER = 21, + VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, + VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, + VK_OBJECT_TYPE_FRAMEBUFFER = 24, + VK_OBJECT_TYPE_COMMAND_POOL = 25, + VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, + VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, + VK_OBJECT_TYPE_DISPLAY_KHR = 1000002000, + VK_OBJECT_TYPE_DISPLAY_MODE_KHR = 1000002001, + VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000, + VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = 1000085000, + VK_OBJECT_TYPE_OBJECT_TABLE_NVX = 1000086000, + VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX = 1000086001, + VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = 1000156000, + VK_OBJECT_TYPE_VALIDATION_CACHE_EXT = 1000160000, + VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkObjectType; + +typedef VkFlags VkInstanceCreateFlags; + +typedef enum VkFormatFeatureFlagBits +{ + VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, + VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, + VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, + VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, + VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, + VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, + VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, + VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, + VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000, + VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = 0x00010000, + VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = 0x00020000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = 0x00040000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = 0x00080000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = 0x00100000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = 0x00200000, + VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = 0x00400000, + VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = 0x00800000, + VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkFormatFeatureFlagBits; +typedef VkFlags VkFormatFeatureFlags; + +typedef enum VkImageUsageFlagBits +{ + VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, + VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, + VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, + VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, + VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, + VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, + VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageUsageFlagBits; +typedef VkFlags VkImageUsageFlags; + +typedef enum VkImageCreateFlagBits +{ + VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, + VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, + VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, + VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, + VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, + VK_IMAGE_CREATE_BIND_SFR_BIT_KHX = 0x00000040, + VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020, + VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = 0x00000080, + VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR = 0x00000100, + VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, + VK_IMAGE_CREATE_DISJOINT_BIT_KHR = 0x00000200, + VK_IMAGE_CREATE_ALIAS_BIT_KHR = 0x00000400, + VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageCreateFlagBits; +typedef VkFlags VkImageCreateFlags; + +typedef enum VkSampleCountFlagBits +{ + VK_SAMPLE_COUNT_1_BIT = 0x00000001, + VK_SAMPLE_COUNT_2_BIT = 0x00000002, + VK_SAMPLE_COUNT_4_BIT = 0x00000004, + VK_SAMPLE_COUNT_8_BIT = 0x00000008, + VK_SAMPLE_COUNT_16_BIT = 0x00000010, + VK_SAMPLE_COUNT_32_BIT = 0x00000020, + VK_SAMPLE_COUNT_64_BIT = 0x00000040, + VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSampleCountFlagBits; +typedef VkFlags VkSampleCountFlags; + +typedef enum VkQueueFlagBits +{ + VK_QUEUE_GRAPHICS_BIT = 0x00000001, + VK_QUEUE_COMPUTE_BIT = 0x00000002, + VK_QUEUE_TRANSFER_BIT = 0x00000004, + VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, + VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueueFlagBits; +typedef VkFlags VkQueueFlags; + +typedef enum VkMemoryPropertyFlagBits +{ + VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, + VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, + VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, + VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryPropertyFlagBits; +typedef VkFlags VkMemoryPropertyFlags; + +typedef enum VkMemoryHeapFlagBits +{ + VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHX = 0x00000002, + VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkMemoryHeapFlagBits; +typedef VkFlags VkMemoryHeapFlags; +typedef VkFlags VkDeviceCreateFlags; +typedef VkFlags VkDeviceQueueCreateFlags; + +typedef enum VkPipelineStageFlagBits +{ + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, + VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, + VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, + VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, + VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, + VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, + VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, + VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, + VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, + VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, + VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, + VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000, + VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPipelineStageFlagBits; +typedef VkFlags VkPipelineStageFlags; +typedef VkFlags VkMemoryMapFlags; + +typedef enum VkImageAspectFlagBits +{ + VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, + VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, + VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, + VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, + VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = 0x00000010, + VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = 0x00000020, + VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = 0x00000040, + VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkImageAspectFlagBits; +typedef VkFlags VkImageAspectFlags; + +typedef enum VkFenceCreateFlagBits +{ + VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, + VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkFenceCreateFlagBits; +typedef VkFlags VkFenceCreateFlags; +typedef VkFlags VkSemaphoreCreateFlags; +typedef VkFlags VkEventCreateFlags; +typedef VkFlags VkQueryPoolCreateFlags; + +typedef enum VkQueryPipelineStatisticFlagBits +{ + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, + VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, + VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, + VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, + VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryPipelineStatisticFlagBits; +typedef VkFlags VkQueryPipelineStatisticFlags; + +typedef enum VkQueryResultFlagBits +{ + VK_QUERY_RESULT_64_BIT = 0x00000001, + VK_QUERY_RESULT_WAIT_BIT = 0x00000002, + VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, + VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, + VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryResultFlagBits; +typedef VkFlags VkQueryResultFlags; + +typedef enum VkBufferCreateFlagBits +{ + VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, + VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, + VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, + VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkBufferCreateFlagBits; +typedef VkFlags VkBufferCreateFlags; + +typedef enum VkBufferUsageFlagBits +{ + VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, + VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, + VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, + VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, + VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, + VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, + VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkBufferUsageFlagBits; +typedef VkFlags VkBufferUsageFlags; +typedef VkFlags VkBufferViewCreateFlags; +typedef VkFlags VkImageViewCreateFlags; +typedef VkFlags VkShaderModuleCreateFlags; +typedef VkFlags VkPipelineCacheCreateFlags; + +typedef enum VkPipelineCreateFlagBits +{ + VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, + VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, + VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, + VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHX = 0x00000008, + VK_PIPELINE_CREATE_DISPATCH_BASE_KHX = 0x00000010, + VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPipelineCreateFlagBits; +typedef VkFlags VkPipelineCreateFlags; +typedef VkFlags VkPipelineShaderStageCreateFlags; + +typedef enum VkShaderStageFlagBits +{ + VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, + VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, + VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, + VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, + VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, + VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, + VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, + VK_SHADER_STAGE_ALL = 0x7FFFFFFF, + VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkShaderStageFlagBits; +typedef VkFlags VkPipelineVertexInputStateCreateFlags; +typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; +typedef VkFlags VkPipelineTessellationStateCreateFlags; +typedef VkFlags VkPipelineViewportStateCreateFlags; +typedef VkFlags VkPipelineRasterizationStateCreateFlags; + +typedef VkFlags VkPipelineMultisampleStateCreateFlags; +typedef VkFlags VkPipelineDepthStencilStateCreateFlags; +typedef VkFlags VkPipelineColorBlendStateCreateFlags; + +typedef VkFlags VkPipelineDynamicStateCreateFlags; +typedef VkFlags VkPipelineLayoutCreateFlags; +typedef VkFlags VkShaderStageFlags; +typedef VkFlags VkSamplerCreateFlags; + +typedef enum VkDescriptorSetLayoutCreateFlagBits +{ + VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorSetLayoutCreateFlagBits; +typedef VkFlags VkDescriptorSetLayoutCreateFlags; + +typedef enum VkDescriptorPoolCreateFlagBits +{ + VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, + VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorPoolCreateFlagBits; +typedef VkFlags VkDescriptorPoolCreateFlags; +typedef VkFlags VkDescriptorPoolResetFlags; +typedef VkFlags VkFramebufferCreateFlags; +typedef VkFlags VkRenderPassCreateFlags; + +typedef enum VkAccessFlagBits +{ + VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, + VK_ACCESS_INDEX_READ_BIT = 0x00000002, + VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, + VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, + VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, + VK_ACCESS_SHADER_READ_BIT = 0x00000020, + VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, + VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, + VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, + VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, + VK_ACCESS_HOST_READ_BIT = 0x00002000, + VK_ACCESS_HOST_WRITE_BIT = 0x00004000, + VK_ACCESS_MEMORY_READ_BIT = 0x00008000, + VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, + VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000, + VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000, + VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000, + VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkAccessFlagBits; +typedef VkFlags VkAccessFlags; + +typedef enum VkDependencyFlagBits +{ + VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, + VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX = 0x00000002, + VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX = 0x00000004, + VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDependencyFlagBits; +typedef VkFlags VkDependencyFlags; + +typedef enum VkCommandPoolCreateFlagBits +{ + VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, + VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, + VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandPoolCreateFlagBits; +typedef VkFlags VkCommandPoolCreateFlags; + +typedef enum VkCommandPoolResetFlagBits +{ + VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, + VK_COMMAND_POOL_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandPoolResetFlagBits; +typedef VkFlags VkCommandPoolResetFlags; + +typedef enum VkCommandBufferUsageFlagBits +{ + VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, + VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, + VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, + VK_COMMAND_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferUsageFlagBits; +typedef VkFlags VkCommandBufferUsageFlags; + +typedef enum VkQueryControlFlagBits +{ + VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, + VK_QUERY_CONTROL_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkQueryControlFlagBits; +typedef VkFlags VkQueryControlFlags; + +typedef enum VkCommandBufferResetFlagBits +{ + VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, + VK_COMMAND_BUFFER_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkCommandBufferResetFlagBits; +typedef VkFlags VkCommandBufferResetFlags; + +typedef struct VkApplicationInfo +{ + VkStructureType sType; + const void* pNext; + const char* pApplicationName; + uint32_t applicationVersion; + const char* pEngineName; + uint32_t engineVersion; + uint32_t apiVersion; +} VkApplicationInfo; + +typedef struct VkInstanceCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkInstanceCreateFlags flags; + const VkApplicationInfo* pApplicationInfo; + uint32_t enabledLayerCount; + const char* const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char* const* ppEnabledExtensionNames; +} VkInstanceCreateInfo; + +typedef void*(VKAPI_PTR* PFN_vkAllocationFunction)( + void* pUserData, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + +typedef void*(VKAPI_PTR* PFN_vkReallocationFunction)( + void* pUserData, + void* pOriginal, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + +typedef void(VKAPI_PTR* PFN_vkFreeFunction)( + void* pUserData, + void* pMemory); + +typedef void(VKAPI_PTR* PFN_vkInternalAllocationNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + +typedef void(VKAPI_PTR* PFN_vkInternalFreeNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + +typedef struct VkAllocationCallbacks +{ + void* pUserData; + PFN_vkAllocationFunction pfnAllocation; + PFN_vkReallocationFunction pfnReallocation; + PFN_vkFreeFunction pfnFree; + PFN_vkInternalAllocationNotification pfnInternalAllocation; + PFN_vkInternalFreeNotification pfnInternalFree; +} VkAllocationCallbacks; + +typedef struct VkPhysicalDeviceFeatures +{ + VkBool32 robustBufferAccess; + VkBool32 fullDrawIndexUint32; + VkBool32 imageCubeArray; + VkBool32 independentBlend; + VkBool32 geometryShader; + VkBool32 tessellationShader; + VkBool32 sampleRateShading; + VkBool32 dualSrcBlend; + VkBool32 logicOp; + VkBool32 multiDrawIndirect; + VkBool32 drawIndirectFirstInstance; + VkBool32 depthClamp; + VkBool32 depthBiasClamp; + VkBool32 fillModeNonSolid; + VkBool32 depthBounds; + VkBool32 wideLines; + VkBool32 largePoints; + VkBool32 alphaToOne; + VkBool32 multiViewport; + VkBool32 samplerAnisotropy; + VkBool32 textureCompressionETC2; + VkBool32 textureCompressionASTC_LDR; + VkBool32 textureCompressionBC; + VkBool32 occlusionQueryPrecise; + VkBool32 pipelineStatisticsQuery; + VkBool32 vertexPipelineStoresAndAtomics; + VkBool32 fragmentStoresAndAtomics; + VkBool32 shaderTessellationAndGeometryPointSize; + VkBool32 shaderImageGatherExtended; + VkBool32 shaderStorageImageExtendedFormats; + VkBool32 shaderStorageImageMultisample; + VkBool32 shaderStorageImageReadWithoutFormat; + VkBool32 shaderStorageImageWriteWithoutFormat; + VkBool32 shaderUniformBufferArrayDynamicIndexing; + VkBool32 shaderSampledImageArrayDynamicIndexing; + VkBool32 shaderStorageBufferArrayDynamicIndexing; + VkBool32 shaderStorageImageArrayDynamicIndexing; + VkBool32 shaderClipDistance; + VkBool32 shaderCullDistance; + VkBool32 shaderFloat64; + VkBool32 shaderInt64; + VkBool32 shaderInt16; + VkBool32 shaderResourceResidency; + VkBool32 shaderResourceMinLod; + VkBool32 sparseBinding; + VkBool32 sparseResidencyBuffer; + VkBool32 sparseResidencyImage2D; + VkBool32 sparseResidencyImage3D; + VkBool32 sparseResidency2Samples; + VkBool32 sparseResidency4Samples; + VkBool32 sparseResidency8Samples; + VkBool32 sparseResidency16Samples; + VkBool32 sparseResidencyAliased; + VkBool32 variableMultisampleRate; + VkBool32 inheritedQueries; +} VkPhysicalDeviceFeatures; + +typedef struct VkFormatProperties +{ + VkFormatFeatureFlags linearTilingFeatures; + VkFormatFeatureFlags optimalTilingFeatures; + VkFormatFeatureFlags bufferFeatures; +} VkFormatProperties; + +typedef struct VkExtent3D +{ + uint32_t width; + uint32_t height; + uint32_t depth; +} VkExtent3D; + +typedef struct VkImageFormatProperties +{ + VkExtent3D maxExtent; + uint32_t maxMipLevels; + uint32_t maxArrayLayers; + VkSampleCountFlags sampleCounts; + VkDeviceSize maxResourceSize; +} VkImageFormatProperties; + +typedef struct VkPhysicalDeviceLimits +{ + uint32_t maxImageDimension1D; + uint32_t maxImageDimension2D; + uint32_t maxImageDimension3D; + uint32_t maxImageDimensionCube; + uint32_t maxImageArrayLayers; + uint32_t maxTexelBufferElements; + uint32_t maxUniformBufferRange; + uint32_t maxStorageBufferRange; + uint32_t maxPushConstantsSize; + uint32_t maxMemoryAllocationCount; + uint32_t maxSamplerAllocationCount; + VkDeviceSize bufferImageGranularity; + VkDeviceSize sparseAddressSpaceSize; + uint32_t maxBoundDescriptorSets; + uint32_t maxPerStageDescriptorSamplers; + uint32_t maxPerStageDescriptorUniformBuffers; + uint32_t maxPerStageDescriptorStorageBuffers; + uint32_t maxPerStageDescriptorSampledImages; + uint32_t maxPerStageDescriptorStorageImages; + uint32_t maxPerStageDescriptorInputAttachments; + uint32_t maxPerStageResources; + uint32_t maxDescriptorSetSamplers; + uint32_t maxDescriptorSetUniformBuffers; + uint32_t maxDescriptorSetUniformBuffersDynamic; + uint32_t maxDescriptorSetStorageBuffers; + uint32_t maxDescriptorSetStorageBuffersDynamic; + uint32_t maxDescriptorSetSampledImages; + uint32_t maxDescriptorSetStorageImages; + uint32_t maxDescriptorSetInputAttachments; + uint32_t maxVertexInputAttributes; + uint32_t maxVertexInputBindings; + uint32_t maxVertexInputAttributeOffset; + uint32_t maxVertexInputBindingStride; + uint32_t maxVertexOutputComponents; + uint32_t maxTessellationGenerationLevel; + uint32_t maxTessellationPatchSize; + uint32_t maxTessellationControlPerVertexInputComponents; + uint32_t maxTessellationControlPerVertexOutputComponents; + uint32_t maxTessellationControlPerPatchOutputComponents; + uint32_t maxTessellationControlTotalOutputComponents; + uint32_t maxTessellationEvaluationInputComponents; + uint32_t maxTessellationEvaluationOutputComponents; + uint32_t maxGeometryShaderInvocations; + uint32_t maxGeometryInputComponents; + uint32_t maxGeometryOutputComponents; + uint32_t maxGeometryOutputVertices; + uint32_t maxGeometryTotalOutputComponents; + uint32_t maxFragmentInputComponents; + uint32_t maxFragmentOutputAttachments; + uint32_t maxFragmentDualSrcAttachments; + uint32_t maxFragmentCombinedOutputResources; + uint32_t maxComputeSharedMemorySize; + uint32_t maxComputeWorkGroupCount[3]; + uint32_t maxComputeWorkGroupInvocations; + uint32_t maxComputeWorkGroupSize[3]; + uint32_t subPixelPrecisionBits; + uint32_t subTexelPrecisionBits; + uint32_t mipmapPrecisionBits; + uint32_t maxDrawIndexedIndexValue; + uint32_t maxDrawIndirectCount; + float maxSamplerLodBias; + float maxSamplerAnisotropy; + uint32_t maxViewports; + uint32_t maxViewportDimensions[2]; + float viewportBoundsRange[2]; + uint32_t viewportSubPixelBits; + size_t minMemoryMapAlignment; + VkDeviceSize minTexelBufferOffsetAlignment; + VkDeviceSize minUniformBufferOffsetAlignment; + VkDeviceSize minStorageBufferOffsetAlignment; + int32_t minTexelOffset; + uint32_t maxTexelOffset; + int32_t minTexelGatherOffset; + uint32_t maxTexelGatherOffset; + float minInterpolationOffset; + float maxInterpolationOffset; + uint32_t subPixelInterpolationOffsetBits; + uint32_t maxFramebufferWidth; + uint32_t maxFramebufferHeight; + uint32_t maxFramebufferLayers; + VkSampleCountFlags framebufferColorSampleCounts; + VkSampleCountFlags framebufferDepthSampleCounts; + VkSampleCountFlags framebufferStencilSampleCounts; + VkSampleCountFlags framebufferNoAttachmentsSampleCounts; + uint32_t maxColorAttachments; + VkSampleCountFlags sampledImageColorSampleCounts; + VkSampleCountFlags sampledImageIntegerSampleCounts; + VkSampleCountFlags sampledImageDepthSampleCounts; + VkSampleCountFlags sampledImageStencilSampleCounts; + VkSampleCountFlags storageImageSampleCounts; + uint32_t maxSampleMaskWords; + VkBool32 timestampComputeAndGraphics; + float timestampPeriod; + uint32_t maxClipDistances; + uint32_t maxCullDistances; + uint32_t maxCombinedClipAndCullDistances; + uint32_t discreteQueuePriorities; + float pointSizeRange[2]; + float lineWidthRange[2]; + float pointSizeGranularity; + float lineWidthGranularity; + VkBool32 strictLines; + VkBool32 standardSampleLocations; + VkDeviceSize optimalBufferCopyOffsetAlignment; + VkDeviceSize optimalBufferCopyRowPitchAlignment; + VkDeviceSize nonCoherentAtomSize; +} VkPhysicalDeviceLimits; + +typedef struct VkPhysicalDeviceSparseProperties +{ + VkBool32 residencyStandard2DBlockShape; + VkBool32 residencyStandard2DMultisampleBlockShape; + VkBool32 residencyStandard3DBlockShape; + VkBool32 residencyAlignedMipSize; + VkBool32 residencyNonResidentStrict; +} VkPhysicalDeviceSparseProperties; + +typedef struct VkPhysicalDeviceProperties +{ + uint32_t apiVersion; + uint32_t driverVersion; + uint32_t vendorID; + uint32_t deviceID; + VkPhysicalDeviceType deviceType; + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; + uint8_t pipelineCacheUUID[VK_UUID_SIZE]; + VkPhysicalDeviceLimits limits; + VkPhysicalDeviceSparseProperties sparseProperties; +} VkPhysicalDeviceProperties; + +typedef struct VkQueueFamilyProperties +{ + VkQueueFlags queueFlags; + uint32_t queueCount; + uint32_t timestampValidBits; + VkExtent3D minImageTransferGranularity; +} VkQueueFamilyProperties; + +typedef struct VkMemoryType +{ + VkMemoryPropertyFlags propertyFlags; + uint32_t heapIndex; +} VkMemoryType; + +typedef struct VkMemoryHeap +{ + VkDeviceSize size; + VkMemoryHeapFlags flags; +} VkMemoryHeap; + +typedef struct VkPhysicalDeviceMemoryProperties +{ + uint32_t memoryTypeCount; + VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; + uint32_t memoryHeapCount; + VkMemoryHeap memoryHeaps[VK_MAX_MEMORY_HEAPS]; +} VkPhysicalDeviceMemoryProperties; + +typedef void(VKAPI_PTR* PFN_vkVoidFunction)(void); +typedef struct VkDeviceQueueCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkDeviceQueueCreateFlags flags; + uint32_t queueFamilyIndex; + uint32_t queueCount; + const float* pQueuePriorities; +} VkDeviceQueueCreateInfo; + +typedef struct VkDeviceCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkDeviceCreateFlags flags; + uint32_t queueCreateInfoCount; + const VkDeviceQueueCreateInfo* pQueueCreateInfos; + uint32_t enabledLayerCount; + const char* const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char* const* ppEnabledExtensionNames; + const VkPhysicalDeviceFeatures* pEnabledFeatures; +} VkDeviceCreateInfo; + +typedef struct VkExtensionProperties +{ + char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; +} VkExtensionProperties; + +typedef struct VkLayerProperties +{ + char layerName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; + uint32_t implementationVersion; + char description[VK_MAX_DESCRIPTION_SIZE]; +} VkLayerProperties; + +typedef struct VkSubmitInfo +{ + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore* pWaitSemaphores; + const VkPipelineStageFlags* pWaitDstStageMask; + uint32_t commandBufferCount; + const VkCommandBuffer* pCommandBuffers; + uint32_t signalSemaphoreCount; + const VkSemaphore* pSignalSemaphores; +} VkSubmitInfo; + +typedef struct VkMemoryAllocateInfo +{ + VkStructureType sType; + const void* pNext; + VkDeviceSize allocationSize; + uint32_t memoryTypeIndex; +} VkMemoryAllocateInfo; + +typedef struct VkMappedMemoryRange +{ + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; + VkDeviceSize offset; + VkDeviceSize size; +} VkMappedMemoryRange; + +typedef struct VkMemoryRequirements +{ + VkDeviceSize size; + VkDeviceSize alignment; + uint32_t memoryTypeBits; +} VkMemoryRequirements; + +typedef struct VkImageSubresource +{ + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t arrayLayer; +} VkImageSubresource; + +typedef struct VkOffset3D +{ + int32_t x; + int32_t y; + int32_t z; +} VkOffset3D; + +typedef struct VkFenceCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkFenceCreateFlags flags; +} VkFenceCreateInfo; + +typedef struct VkSemaphoreCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkSemaphoreCreateFlags flags; +} VkSemaphoreCreateInfo; + +typedef struct VkQueryPoolCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkQueryPoolCreateFlags flags; + VkQueryType queryType; + uint32_t queryCount; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkQueryPoolCreateInfo; + +typedef struct VkBufferCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkDeviceSize size; + VkBufferUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; +} VkBufferCreateInfo; + +typedef struct VkBufferViewCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkBufferViewCreateFlags flags; + VkBuffer buffer; + VkFormat format; + VkDeviceSize offset; + VkDeviceSize range; +} VkBufferViewCreateInfo; + +typedef struct VkImageCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkImageCreateFlags flags; + VkImageType imageType; + VkFormat format; + VkExtent3D extent; + uint32_t mipLevels; + uint32_t arrayLayers; + VkSampleCountFlagBits samples; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; + VkImageLayout initialLayout; +} VkImageCreateInfo; + +typedef struct VkSubresourceLayout +{ + VkDeviceSize offset; + VkDeviceSize size; + VkDeviceSize rowPitch; + VkDeviceSize arrayPitch; + VkDeviceSize depthPitch; +} VkSubresourceLayout; + +typedef struct VkComponentMapping +{ + VkComponentSwizzle r; + VkComponentSwizzle g; + VkComponentSwizzle b; + VkComponentSwizzle a; +} VkComponentMapping; + +typedef struct VkImageSubresourceRange +{ + VkImageAspectFlags aspectMask; + uint32_t baseMipLevel; + uint32_t levelCount; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceRange; + +typedef struct VkImageViewCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkImageViewCreateFlags flags; + VkImage image; + VkImageViewType viewType; + VkFormat format; + VkComponentMapping components; + VkImageSubresourceRange subresourceRange; +} VkImageViewCreateInfo; + +typedef struct VkShaderModuleCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkShaderModuleCreateFlags flags; + size_t codeSize; + const uint32_t* pCode; +} VkShaderModuleCreateInfo; + +typedef struct VkPipelineCacheCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkPipelineCacheCreateFlags flags; + size_t initialDataSize; + const void* pInitialData; +} VkPipelineCacheCreateInfo; + +typedef struct VkSpecializationMapEntry +{ + uint32_t constantID; + uint32_t offset; + size_t size; +} VkSpecializationMapEntry; + +typedef struct VkSpecializationInfo +{ + uint32_t mapEntryCount; + const VkSpecializationMapEntry* pMapEntries; + size_t dataSize; + const void* pData; +} VkSpecializationInfo; + +typedef struct VkPipelineShaderStageCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkPipelineShaderStageCreateFlags flags; + VkShaderStageFlagBits stage; + VkShaderModule module; + const char* pName; + const VkSpecializationInfo* pSpecializationInfo; +} VkPipelineShaderStageCreateInfo; + +typedef struct VkViewport +{ + float x; + float y; + float width; + float height; + float minDepth; + float maxDepth; +} VkViewport; + +typedef struct VkOffset2D +{ + int32_t x; + int32_t y; +} VkOffset2D; + +typedef struct VkExtent2D +{ + uint32_t width; + uint32_t height; +} VkExtent2D; + +typedef struct VkRect2D +{ + VkOffset2D offset; + VkExtent2D extent; +} VkRect2D; + +typedef struct VkComputePipelineCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkPipelineCreateFlags flags; + VkPipelineShaderStageCreateInfo stage; + VkPipelineLayout layout; + VkPipeline basePipelineHandle; + int32_t basePipelineIndex; +} VkComputePipelineCreateInfo; + +typedef struct VkPushConstantRange +{ + VkShaderStageFlags stageFlags; + uint32_t offset; + uint32_t size; +} VkPushConstantRange; + +typedef struct VkPipelineLayoutCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkPipelineLayoutCreateFlags flags; + uint32_t setLayoutCount; + const VkDescriptorSetLayout* pSetLayouts; + uint32_t pushConstantRangeCount; + const VkPushConstantRange* pPushConstantRanges; +} VkPipelineLayoutCreateInfo; + +typedef struct VkSamplerCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkSamplerCreateFlags flags; + VkFilter magFilter; + VkFilter minFilter; + VkSamplerMipmapMode mipmapMode; + VkSamplerAddressMode addressModeU; + VkSamplerAddressMode addressModeV; + VkSamplerAddressMode addressModeW; + float mipLodBias; + VkBool32 anisotropyEnable; + float maxAnisotropy; + VkBool32 compareEnable; + VkCompareOp compareOp; + float minLod; + float maxLod; + VkBorderColor borderColor; + VkBool32 unnormalizedCoordinates; +} VkSamplerCreateInfo; + +typedef struct VkDescriptorSetLayoutBinding +{ + uint32_t binding; + VkDescriptorType descriptorType; + uint32_t descriptorCount; + VkShaderStageFlags stageFlags; + const VkSampler* pImmutableSamplers; +} VkDescriptorSetLayoutBinding; + +typedef struct VkDescriptorSetLayoutCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkDescriptorSetLayoutCreateFlags flags; + uint32_t bindingCount; + const VkDescriptorSetLayoutBinding* pBindings; +} VkDescriptorSetLayoutCreateInfo; + +typedef struct VkDescriptorPoolSize +{ + VkDescriptorType type; + uint32_t descriptorCount; +} VkDescriptorPoolSize; + +typedef struct VkDescriptorPoolCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkDescriptorPoolCreateFlags flags; + uint32_t maxSets; + uint32_t poolSizeCount; + const VkDescriptorPoolSize* pPoolSizes; +} VkDescriptorPoolCreateInfo; + +typedef struct VkDescriptorSetAllocateInfo +{ + VkStructureType sType; + const void* pNext; + VkDescriptorPool descriptorPool; + uint32_t descriptorSetCount; + const VkDescriptorSetLayout* pSetLayouts; +} VkDescriptorSetAllocateInfo; + +typedef struct VkDescriptorImageInfo +{ + VkSampler sampler; + VkImageView imageView; + VkImageLayout imageLayout; +} VkDescriptorImageInfo; + +typedef struct VkDescriptorBufferInfo +{ + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize range; +} VkDescriptorBufferInfo; + +typedef struct VkWriteDescriptorSet +{ + VkStructureType sType; + const void* pNext; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + const VkDescriptorImageInfo* pImageInfo; + const VkDescriptorBufferInfo* pBufferInfo; + const VkBufferView* pTexelBufferView; +} VkWriteDescriptorSet; + +typedef struct VkCopyDescriptorSet +{ + VkStructureType sType; + const void* pNext; + VkDescriptorSet srcSet; + uint32_t srcBinding; + uint32_t srcArrayElement; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; +} VkCopyDescriptorSet; + +typedef struct VkCommandPoolCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkCommandPoolCreateFlags flags; + uint32_t queueFamilyIndex; +} VkCommandPoolCreateInfo; + +typedef struct VkCommandBufferAllocateInfo +{ + VkStructureType sType; + const void* pNext; + VkCommandPool commandPool; + VkCommandBufferLevel level; + uint32_t commandBufferCount; +} VkCommandBufferAllocateInfo; + +typedef struct VkCommandBufferInheritanceInfo +{ + VkStructureType sType; + const void* pNext; + VkRenderPass renderPass; + uint32_t subpass; + VkFramebuffer framebuffer; + VkBool32 occlusionQueryEnable; + VkQueryControlFlags queryFlags; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkCommandBufferInheritanceInfo; + +typedef struct VkCommandBufferBeginInfo +{ + VkStructureType sType; + const void* pNext; + VkCommandBufferUsageFlags flags; + const VkCommandBufferInheritanceInfo* pInheritanceInfo; +} VkCommandBufferBeginInfo; + +typedef struct VkBufferCopy +{ + VkDeviceSize srcOffset; + VkDeviceSize dstOffset; + VkDeviceSize size; +} VkBufferCopy; + +typedef struct VkImageSubresourceLayers +{ + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceLayers; + +typedef struct VkImageCopy +{ + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageCopy; + +typedef struct VkBufferImageCopy +{ + VkDeviceSize bufferOffset; + uint32_t bufferRowLength; + uint32_t bufferImageHeight; + VkImageSubresourceLayers imageSubresource; + VkOffset3D imageOffset; + VkExtent3D imageExtent; +} VkBufferImageCopy; + +typedef struct VkImageResolve +{ + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageResolve; + +typedef struct VkMemoryBarrier +{ + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; +} VkMemoryBarrier; + +typedef struct VkBufferMemoryBarrier +{ + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize size; +} VkBufferMemoryBarrier; + +typedef struct VkImageMemoryBarrier +{ + VkStructureType sType; + const void* pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkImageLayout oldLayout; + VkImageLayout newLayout; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkImage image; + VkImageSubresourceRange subresourceRange; +} VkImageMemoryBarrier; + +typedef struct VkDispatchIndirectCommand +{ + uint32_t x; + uint32_t y; + uint32_t z; +} VkDispatchIndirectCommand; + +// vulkan base functions +typedef VkResult(VKAPI_PTR* PFN_vkEnumerateInstanceExtensionProperties)(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance); +typedef PFN_vkVoidFunction(VKAPI_PTR* PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); + +typedef VkResult(VKAPI_PTR* PFN_vkAllocateCommandBuffers)(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers); +typedef VkResult(VKAPI_PTR* PFN_vkAllocateDescriptorSets)(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets); +typedef VkResult(VKAPI_PTR* PFN_vkAllocateMemory)(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory); +typedef VkResult(VKAPI_PTR* PFN_vkBeginCommandBuffer)(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo); +typedef VkResult(VKAPI_PTR* PFN_vkBindBufferMemory)(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); +typedef VkResult(VKAPI_PTR* PFN_vkBindImageMemory)(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); +typedef void(VKAPI_PTR* PFN_vkCmdBeginQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); +typedef void(VKAPI_PTR* PFN_vkCmdBindDescriptorSets)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets); +typedef void(VKAPI_PTR* PFN_vkCmdBindIndexBuffer)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); +typedef void(VKAPI_PTR* PFN_vkCmdBindPipeline)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); +typedef void(VKAPI_PTR* PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions); +typedef void(VKAPI_PTR* PFN_vkCmdCopyBufferToImage)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions); +typedef void(VKAPI_PTR* PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); +typedef void(VKAPI_PTR* PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions); +typedef void(VKAPI_PTR* PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); +typedef void(VKAPI_PTR* PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef void(VKAPI_PTR* PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); +typedef void(VKAPI_PTR* PFN_vkCmdEndQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); +typedef void(VKAPI_PTR* PFN_vkCmdExecuteCommands)(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); +typedef void(VKAPI_PTR* PFN_vkCmdFillBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); +typedef void(VKAPI_PTR* PFN_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); +typedef void(VKAPI_PTR* PFN_vkCmdPushConstants)(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues); +typedef void(VKAPI_PTR* PFN_vkCmdResetQueryPool)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); +typedef void(VKAPI_PTR* PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions); +typedef void(VKAPI_PTR* PFN_vkCmdUpdateBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData); +typedef void(VKAPI_PTR* PFN_vkCmdWriteTimestamp)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); +typedef VkResult(VKAPI_PTR* PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer); +typedef VkResult(VKAPI_PTR* PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView); +typedef VkResult(VKAPI_PTR* PFN_vkCreateCommandPool)(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool); +typedef VkResult(VKAPI_PTR* PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); +typedef VkResult(VKAPI_PTR* PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool); +typedef VkResult(VKAPI_PTR* PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout); +typedef VkResult(VKAPI_PTR* PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice); +typedef VkResult(VKAPI_PTR* PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); +typedef VkResult(VKAPI_PTR* PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage); +typedef VkResult(VKAPI_PTR* PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView); +typedef VkResult(VKAPI_PTR* PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache); +typedef VkResult(VKAPI_PTR* PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout); +typedef VkResult(VKAPI_PTR* PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool); +typedef VkResult(VKAPI_PTR* PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler); +typedef VkResult(VKAPI_PTR* PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore); +typedef VkResult(VKAPI_PTR* PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule); +typedef void(VKAPI_PTR* PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyCommandPool)(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyImage)(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroySampler)(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator); +typedef VkResult(VKAPI_PTR* PFN_vkDeviceWaitIdle)(VkDevice device); +typedef VkResult(VKAPI_PTR* PFN_vkEndCommandBuffer)(VkCommandBuffer commandBuffer); +typedef VkResult(VKAPI_PTR* PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkEnumerateInstanceLayerProperties)(uint32_t* pPropertyCount, VkLayerProperties* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); +typedef VkResult(VKAPI_PTR* PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); +typedef void(VKAPI_PTR* PFN_vkFreeCommandBuffers)(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); +typedef VkResult(VKAPI_PTR* PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets); +typedef void(VKAPI_PTR* PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements); +typedef void(VKAPI_PTR* PFN_vkGetDeviceMemoryCommitment)(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes); +typedef void(VKAPI_PTR* PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); +typedef PFN_vkVoidFunction(VKAPI_PTR* PFN_vkGetDeviceProcAddr)(VkDevice device, const char* pName); +typedef VkResult(VKAPI_PTR* PFN_vkGetFenceStatus)(VkDevice device, VkFence fence); +typedef void(VKAPI_PTR* PFN_vkGetImageMemoryRequirements)(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements); +typedef void(VKAPI_PTR* PFN_vkGetImageSubresourceLayout)(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties); +typedef VkResult(VKAPI_PTR* PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData); +typedef VkResult(VKAPI_PTR* PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags); +typedef VkResult(VKAPI_PTR* PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); +typedef VkResult(VKAPI_PTR* PFN_vkMapMemory)(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData); +typedef VkResult(VKAPI_PTR* PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches); +typedef VkResult(VKAPI_PTR* PFN_vkQueueSubmit)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); +typedef VkResult(VKAPI_PTR* PFN_vkQueueWaitIdle)(VkQueue queue); +typedef VkResult(VKAPI_PTR* PFN_vkResetCommandBuffer)(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); +typedef VkResult(VKAPI_PTR* PFN_vkResetCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); +typedef VkResult(VKAPI_PTR* PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); +typedef VkResult(VKAPI_PTR* PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences); +typedef void(VKAPI_PTR* PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory memory); +typedef void(VKAPI_PTR* PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies); +typedef VkResult(VKAPI_PTR* PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout); + +#ifndef VK_KHR_surface +#define VK_KHR_surface 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) +#define VK_COLORSPACE_SRGB_NONLINEAR_KHR VK_COLOR_SPACE_SRGB_NONLINEAR_KHR +typedef enum VkColorSpaceKHR +{ + VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, + VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104001, + VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT = 1000104002, + VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104003, + VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104004, + VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104005, + VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104006, + VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104007, + VK_COLOR_SPACE_HDR10_ST2084_EXT = 1000104008, + VK_COLOR_SPACE_DOLBYVISION_EXT = 1000104009, + VK_COLOR_SPACE_HDR10_HLG_EXT = 1000104010, + VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, + VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, + VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, + VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = 1000104014, + VK_COLOR_SPACE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkColorSpaceKHR; +typedef enum VkPresentModeKHR +{ + VK_PRESENT_MODE_IMMEDIATE_KHR = 0, + VK_PRESENT_MODE_MAILBOX_KHR = 1, + VK_PRESENT_MODE_FIFO_KHR = 2, + VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3, + VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000, + VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001, + VK_PRESENT_MODE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkPresentModeKHR; +typedef enum VkSurfaceTransformFlagBitsKHR +{ + VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, + VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, + VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, + VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, + VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, + VK_SURFACE_TRANSFORM_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkSurfaceTransformFlagBitsKHR; +typedef VkFlags VkSurfaceTransformFlagsKHR; +typedef enum VkCompositeAlphaFlagBitsKHR +{ + VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, + VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, + VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, + VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, + VK_COMPOSITE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkCompositeAlphaFlagBitsKHR; +typedef VkFlags VkCompositeAlphaFlagsKHR; +typedef struct VkSurfaceCapabilitiesKHR +{ + uint32_t minImageCount; + uint32_t maxImageCount; + VkExtent2D currentExtent; + VkExtent2D minImageExtent; + VkExtent2D maxImageExtent; + uint32_t maxImageArrayLayers; + VkSurfaceTransformFlagsKHR supportedTransforms; + VkSurfaceTransformFlagBitsKHR currentTransform; + VkCompositeAlphaFlagsKHR supportedCompositeAlpha; + VkImageUsageFlags supportedUsageFlags; +} VkSurfaceCapabilitiesKHR; +typedef struct VkSurfaceFormatKHR +{ + VkFormat format; + VkColorSpaceKHR colorSpace; +} VkSurfaceFormatKHR; +typedef void(VKAPI_PTR* PFN_vkDestroySurfaceKHR)(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes); +#endif // VK_KHR_surface + +#ifndef VK_KHR_swapchain +#define VK_KHR_swapchain 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) +typedef enum VkSwapchainCreateFlagBitsKHR +{ + VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX = 0x00000001, + VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkSwapchainCreateFlagBitsKHR; +typedef VkFlags VkSwapchainCreateFlagsKHR; +typedef struct VkSwapchainCreateInfoKHR +{ + VkStructureType sType; + const void* pNext; + VkSwapchainCreateFlagsKHR flags; + VkSurfaceKHR surface; + uint32_t minImageCount; + VkFormat imageFormat; + VkColorSpaceKHR imageColorSpace; + VkExtent2D imageExtent; + uint32_t imageArrayLayers; + VkImageUsageFlags imageUsage; + VkSharingMode imageSharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; + VkSurfaceTransformFlagBitsKHR preTransform; + VkCompositeAlphaFlagBitsKHR compositeAlpha; + VkPresentModeKHR presentMode; + VkBool32 clipped; + VkSwapchainKHR oldSwapchain; +} VkSwapchainCreateInfoKHR; +typedef struct VkPresentInfoKHR +{ + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore* pWaitSemaphores; + uint32_t swapchainCount; + const VkSwapchainKHR* pSwapchains; + const uint32_t* pImageIndices; + VkResult* pResults; +} VkPresentInfoKHR; +typedef VkResult(VKAPI_PTR* PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain); +typedef void(VKAPI_PTR* PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator); +typedef VkResult(VKAPI_PTR* PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages); +typedef VkResult(VKAPI_PTR* PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex); +typedef VkResult(VKAPI_PTR* PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR* pPresentInfo); +#endif // VK_KHR_swapchain + +#ifndef VK_KHR_android_surface +#define VK_KHR_android_surface 1 +struct ANativeWindow; +typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; +typedef struct VkAndroidSurfaceCreateInfoKHR +{ + VkStructureType sType; + const void* pNext; + VkAndroidSurfaceCreateFlagsKHR flags; + struct ANativeWindow* window; +} VkAndroidSurfaceCreateInfoKHR; +typedef VkResult(VKAPI_PTR* PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); +#endif // VK_KHR_android_surface + +namespace ncnn { + +// vulkan loader entrypoint +extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; + +// vulkan global functions +extern PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties; +extern PFN_vkCreateInstance vkCreateInstance; +extern PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties; + +// Load vulkan driver dynamic library when driver_path is provided +// Load from env VK_ICD_FILENAMES and NCNN_VULKAN_DRIVER otherwise +// If failed, it will try system libvulkan and well-known library names +// The three vulkan base function pointers will be set on success +int load_vulkan_driver(const char* driver_path = 0); + +// Unload vulkan driver library and clear +void unload_vulkan_driver(); + +} // namespace ncnn + +#endif // NCNN_SIMPLEVK +#endif // NCNN_VULKAN + +#endif // NCNN_SIMPLEVK_H diff --git a/app/libs/ncnn/armeabi-v7a/include/ncnn/vulkan_header_fix.h b/app/libs/ncnn/armeabi-v7a/include/ncnn/vulkan_header_fix.h new file mode 100644 index 0000000..ab76467 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/include/ncnn/vulkan_header_fix.h @@ -0,0 +1,1701 @@ +// Copyright 2020 Tencent +// SPDX-License-Identifier: BSD-3-Clause + +#ifndef NCNN_VULKAN_HEADER_FIX_H +#define NCNN_VULKAN_HEADER_FIX_H + +// #include "platform.h" + +// This header contains new structure and function declearation to fix build with old vulkan sdk + +#ifndef VK_KHR_maintenance1 +#define VK_KHR_maintenance1 1 +typedef VkFlags VkCommandPoolTrimFlags; +typedef VkCommandPoolTrimFlags VkCommandPoolTrimFlagsKHR; +typedef void(VKAPI_PTR* PFN_vkTrimCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); +typedef PFN_vkTrimCommandPool PFN_vkTrimCommandPoolKHR; +#endif // VK_KHR_maintenance1 + +#ifndef VK_KHR_get_physical_device_properties2 +#define VK_KHR_get_physical_device_properties2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 (VkStructureType)1000059000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 (VkStructureType)1000059001 +#define VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 (VkStructureType)1000059002 +#define VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 (VkStructureType)1000059003 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 (VkStructureType)1000059004 +#define VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 (VkStructureType)1000059005 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 (VkStructureType)1000059006 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 +#define VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 +#define VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 +#define VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 +typedef struct VkPhysicalDeviceFeatures2 +{ + VkStructureType sType; + void* pNext; + VkPhysicalDeviceFeatures features; +} VkPhysicalDeviceFeatures2; +typedef struct VkPhysicalDeviceProperties2 +{ + VkStructureType sType; + void* pNext; + VkPhysicalDeviceProperties properties; +} VkPhysicalDeviceProperties2; +typedef struct VkFormatProperties2 +{ + VkStructureType sType; + void* pNext; + VkFormatProperties formatProperties; +} VkFormatProperties2; +typedef struct VkImageFormatProperties2 +{ + VkStructureType sType; + void* pNext; + VkImageFormatProperties imageFormatProperties; +} VkImageFormatProperties2; +typedef struct VkPhysicalDeviceImageFormatInfo2 +{ + VkStructureType sType; + const void* pNext; + VkFormat format; + VkImageType type; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkImageCreateFlags flags; +} VkPhysicalDeviceImageFormatInfo2; +typedef struct VkQueueFamilyProperties2 +{ + VkStructureType sType; + void* pNext; + VkQueueFamilyProperties queueFamilyProperties; +} VkQueueFamilyProperties2; +typedef struct VkPhysicalDeviceMemoryProperties2 +{ + VkStructureType sType; + void* pNext; + VkPhysicalDeviceMemoryProperties memoryProperties; +} VkPhysicalDeviceMemoryProperties2; +typedef VkPhysicalDeviceFeatures2 VkPhysicalDeviceFeatures2KHR; +typedef VkPhysicalDeviceProperties2 VkPhysicalDeviceProperties2KHR; +typedef VkFormatProperties2 VkFormatProperties2KHR; +typedef VkImageFormatProperties2 VkImageFormatProperties2KHR; +typedef VkPhysicalDeviceImageFormatInfo2 VkPhysicalDeviceImageFormatInfo2KHR; +typedef VkQueueFamilyProperties2 VkQueueFamilyProperties2KHR; +typedef VkPhysicalDeviceMemoryProperties2 VkPhysicalDeviceMemoryProperties2KHR; +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceFeatures2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceFormatProperties2)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceQueueFamilyProperties2)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties); +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceMemoryProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties); +typedef PFN_vkGetPhysicalDeviceFeatures2 PFN_vkGetPhysicalDeviceFeatures2KHR; +typedef PFN_vkGetPhysicalDeviceProperties2 PFN_vkGetPhysicalDeviceProperties2KHR; +typedef PFN_vkGetPhysicalDeviceFormatProperties2 PFN_vkGetPhysicalDeviceFormatProperties2KHR; +typedef PFN_vkGetPhysicalDeviceImageFormatProperties2 PFN_vkGetPhysicalDeviceImageFormatProperties2KHR; +typedef PFN_vkGetPhysicalDeviceQueueFamilyProperties2 PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR; +typedef PFN_vkGetPhysicalDeviceMemoryProperties2 PFN_vkGetPhysicalDeviceMemoryProperties2KHR; +#endif // VK_KHR_get_physical_device_properties2 + +#ifndef VK_KHR_external_memory_capabilities +#define VK_KHR_external_memory_capabilities 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO (VkStructureType)1000071000 +#define VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES (VkStructureType)1000071001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO (VkStructureType)1000071002 +#define VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES (VkStructureType)1000071003 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES (VkStructureType)1000071004 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO +#define VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO +#define VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES +#define VK_LUID_SIZE 8 +#define VK_LUID_SIZE_KHR VK_LUID_SIZE +typedef enum VkExternalMemoryHandleTypeFlagBits +{ + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 0x00000008, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 0x00000010, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 0x00000020, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 0x00000040, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT = 0x00000200, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID = 0x00000400, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA = 0x00000800, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV = 0x00001000, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryHandleTypeFlagBits; +typedef VkFlags VkExternalMemoryHandleTypeFlags; +typedef enum VkExternalMemoryFeatureFlagBits +{ + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryFeatureFlagBits; +typedef VkFlags VkExternalMemoryFeatureFlags; +typedef struct VkExternalMemoryProperties +{ + VkExternalMemoryFeatureFlags externalMemoryFeatures; + VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes; + VkExternalMemoryHandleTypeFlags compatibleHandleTypes; +} VkExternalMemoryProperties; +typedef struct VkPhysicalDeviceExternalImageFormatInfo +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalImageFormatInfo; +typedef struct VkExternalImageFormatProperties +{ + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalImageFormatProperties; +typedef struct VkPhysicalDeviceExternalBufferInfo +{ + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkBufferUsageFlags usage; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalBufferInfo; +typedef struct VkExternalBufferProperties +{ + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalBufferProperties; +typedef struct VkPhysicalDeviceIDProperties +{ + VkStructureType sType; + void* pNext; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE]; + uint32_t deviceNodeMask; + VkBool32 deviceLUIDValid; +} VkPhysicalDeviceIDProperties; +typedef VkExternalMemoryHandleTypeFlags VkExternalMemoryHandleTypeFlagsKHR; +typedef VkExternalMemoryHandleTypeFlagBits VkExternalMemoryHandleTypeFlagBitsKHR; +typedef VkExternalMemoryFeatureFlags VkExternalMemoryFeatureFlagsKHR; +typedef VkExternalMemoryFeatureFlagBits VkExternalMemoryFeatureFlagBitsKHR; +typedef VkExternalMemoryProperties VkExternalMemoryPropertiesKHR; +typedef VkPhysicalDeviceExternalImageFormatInfo VkPhysicalDeviceExternalImageFormatInfoKHR; +typedef VkExternalImageFormatProperties VkExternalImageFormatPropertiesKHR; +typedef VkPhysicalDeviceExternalBufferInfo VkPhysicalDeviceExternalBufferInfoKHR; +typedef VkExternalBufferProperties VkExternalBufferPropertiesKHR; +typedef VkPhysicalDeviceIDProperties VkPhysicalDeviceIDPropertiesKHR; +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); +typedef PFN_vkGetPhysicalDeviceExternalBufferProperties PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR; +#endif // VK_KHR_external_memory_capabilities + +#ifndef VK_KHR_external_memory +#define VK_KHR_external_memory 1 +#define VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO (VkStructureType)1000072000 +#define VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO (VkStructureType)1000072001 +#define VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO (VkStructureType)1000072002 +#define VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO +#define VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO +#define VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO +#define VK_QUEUE_FAMILY_EXTERNAL_KHR (~0U - 1) +typedef struct VkExternalMemoryImageCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExternalMemoryImageCreateInfo; +typedef struct VkExternalMemoryBufferCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExternalMemoryBufferCreateInfo; +typedef struct VkExportMemoryAllocateInfo +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlags handleTypes; +} VkExportMemoryAllocateInfo; +typedef VkExternalMemoryImageCreateInfo VkExternalMemoryImageCreateInfoKHR; +typedef VkExternalMemoryBufferCreateInfo VkExternalMemoryBufferCreateInfoKHR; +typedef VkExportMemoryAllocateInfo VkExportMemoryAllocateInfoKHR; +#endif // VK_KHR_external_memory + +#ifndef VK_KHR_descriptor_update_template +#define VK_KHR_descriptor_update_template 1 +#define VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO (VkStructureType)1000085000 +#define VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) +typedef VkDescriptorUpdateTemplate VkDescriptorUpdateTemplateKHR; +typedef enum VkDescriptorUpdateTemplateType +{ + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET = 0, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorUpdateTemplateType; +typedef VkFlags VkDescriptorUpdateTemplateCreateFlags; +typedef struct VkDescriptorUpdateTemplateEntry +{ + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + size_t offset; + size_t stride; +} VkDescriptorUpdateTemplateEntry; +typedef struct VkDescriptorUpdateTemplateCreateInfo +{ + VkStructureType sType; + void* pNext; + VkDescriptorUpdateTemplateCreateFlags flags; + uint32_t descriptorUpdateEntryCount; + const VkDescriptorUpdateTemplateEntry* pDescriptorUpdateEntries; + VkDescriptorUpdateTemplateType templateType; + VkDescriptorSetLayout descriptorSetLayout; + VkPipelineBindPoint pipelineBindPoint; + VkPipelineLayout pipelineLayout; + uint32_t set; +} VkDescriptorUpdateTemplateCreateInfo; +typedef VkDescriptorUpdateTemplateType VkDescriptorUpdateTemplateTypeKHR; +typedef VkDescriptorUpdateTemplateCreateFlags VkDescriptorUpdateTemplateCreateFlagsKHR; +typedef VkDescriptorUpdateTemplateEntry VkDescriptorUpdateTemplateEntryKHR; +typedef VkDescriptorUpdateTemplateCreateInfo VkDescriptorUpdateTemplateCreateInfoKHR; +typedef VkResult(VKAPI_PTR* PFN_vkCreateDescriptorUpdateTemplate)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); +typedef void(VKAPI_PTR* PFN_vkDestroyDescriptorUpdateTemplate)(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); +typedef void(VKAPI_PTR* PFN_vkUpdateDescriptorSetWithTemplate)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); +typedef PFN_vkCreateDescriptorUpdateTemplate PFN_vkCreateDescriptorUpdateTemplateKHR; +typedef PFN_vkDestroyDescriptorUpdateTemplate PFN_vkDestroyDescriptorUpdateTemplateKHR; +typedef PFN_vkUpdateDescriptorSetWithTemplate PFN_vkUpdateDescriptorSetWithTemplateKHR; +#endif // VK_KHR_descriptor_update_template + +#ifndef VK_KHR_push_descriptor +#define VK_KHR_push_descriptor 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR (VkStructureType)1000080000 +typedef struct VkPhysicalDevicePushDescriptorPropertiesKHR +{ + VkStructureType sType; + void* pNext; + uint32_t maxPushDescriptors; +} VkPhysicalDevicePushDescriptorPropertiesKHR; +typedef void(VKAPI_PTR* PFN_vkCmdPushDescriptorSetKHR)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); +typedef void(VKAPI_PTR* PFN_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); +#endif // VK_KHR_push_descriptor + +#ifndef VK_KHR_get_surface_capabilities2 +#define VK_KHR_get_surface_capabilities2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR (VkStructureType)1000119000 +#define VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR (VkStructureType)1000119001 +#define VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR (VkStructureType)1000119002 +typedef struct VkPhysicalDeviceSurfaceInfo2KHR +{ + VkStructureType sType; + const void* pNext; + VkSurfaceKHR surface; +} VkPhysicalDeviceSurfaceInfo2KHR; +typedef struct VkSurfaceCapabilities2KHR +{ + VkStructureType sType; + void* pNext; + VkSurfaceCapabilitiesKHR surfaceCapabilities; +} VkSurfaceCapabilities2KHR; +typedef struct VkSurfaceFormat2KHR +{ + VkStructureType sType; + void* pNext; + VkSurfaceFormatKHR surfaceFormat; +} VkSurfaceFormat2KHR; +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities); +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats); +#endif // VK_KHR_get_surface_capabilities2 + +#ifndef VK_KHR_external_memory_capabilities +#define VK_KHR_external_memory_capabilities 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO (VkStructureType)1000071000 +#define VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES (VkStructureType)1000071001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO (VkStructureType)1000071002 +#define VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES (VkStructureType)1000071003 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES (VkStructureType)1000071004 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO +#define VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO +#define VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES +#define VK_LUID_SIZE 8U +#define VK_LUID_SIZE_KHR VK_LUID_SIZE +typedef enum VkExternalMemoryHandleTypeFlagBits +{ + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 0x00000008, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 0x00000010, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 0x00000020, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 0x00000040, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT = 0x00000200, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID = 0x00000400, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT = 0x00000080, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA = 0x00000800, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV = 0x00001000, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryHandleTypeFlagBits; +typedef VkFlags VkExternalMemoryHandleTypeFlags; +typedef enum VkExternalMemoryFeatureFlagBits +{ + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 0x00000001, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 0x00000002, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 0x00000004, + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT, + VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkExternalMemoryFeatureFlagBits; +typedef VkFlags VkExternalMemoryFeatureFlags; +typedef struct VkExternalMemoryProperties +{ + VkExternalMemoryFeatureFlags externalMemoryFeatures; + VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes; + VkExternalMemoryHandleTypeFlags compatibleHandleTypes; +} VkExternalMemoryProperties; +typedef struct VkPhysicalDeviceExternalImageFormatInfo +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalImageFormatInfo; +typedef struct VkExternalImageFormatProperties +{ + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalImageFormatProperties; +typedef struct VkPhysicalDeviceExternalBufferInfo +{ + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkBufferUsageFlags usage; + VkExternalMemoryHandleTypeFlagBits handleType; +} VkPhysicalDeviceExternalBufferInfo; +typedef struct VkExternalBufferProperties +{ + VkStructureType sType; + void* pNext; + VkExternalMemoryProperties externalMemoryProperties; +} VkExternalBufferProperties; +typedef struct VkPhysicalDeviceIDProperties +{ + VkStructureType sType; + void* pNext; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE]; + uint32_t deviceNodeMask; + VkBool32 deviceLUIDValid; +} VkPhysicalDeviceIDProperties; +typedef VkExternalMemoryHandleTypeFlags VkExternalMemoryHandleTypeFlagsKHR; +typedef VkExternalMemoryHandleTypeFlagBits VkExternalMemoryHandleTypeFlagBitsKHR; +typedef VkExternalMemoryFeatureFlags VkExternalMemoryFeatureFlagsKHR; +typedef VkExternalMemoryFeatureFlagBits VkExternalMemoryFeatureFlagBitsKHR; +typedef VkExternalMemoryProperties VkExternalMemoryPropertiesKHR; +typedef VkPhysicalDeviceExternalImageFormatInfo VkPhysicalDeviceExternalImageFormatInfoKHR; +typedef VkExternalImageFormatProperties VkExternalImageFormatPropertiesKHR; +typedef VkPhysicalDeviceExternalBufferInfo VkPhysicalDeviceExternalBufferInfoKHR; +typedef VkExternalBufferProperties VkExternalBufferPropertiesKHR; +typedef VkPhysicalDeviceIDProperties VkPhysicalDeviceIDPropertiesKHR; +typedef void(VKAPI_PTR* PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); +typedef PFN_vkGetPhysicalDeviceExternalBufferProperties PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR; +#endif // VK_KHR_external_memory_capabilities + +#ifndef VK_KHR_get_memory_requirements2 +#define VK_KHR_get_memory_requirements2 1 +#define VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 (VkStructureType)1000146000 +#define VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 (VkStructureType)1000146001 +#define VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 (VkStructureType)1000146003 +#define VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 +#define VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 +#define VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 +typedef struct VkBufferMemoryRequirementsInfo2 +{ + VkStructureType sType; + const void* pNext; + VkBuffer buffer; +} VkBufferMemoryRequirementsInfo2; +typedef struct VkImageMemoryRequirementsInfo2 +{ + VkStructureType sType; + const void* pNext; + VkImage image; +} VkImageMemoryRequirementsInfo2; +typedef struct VkMemoryRequirements2 +{ + VkStructureType sType; + void* pNext; + VkMemoryRequirements memoryRequirements; +} VkMemoryRequirements2; +typedef VkBufferMemoryRequirementsInfo2 VkBufferMemoryRequirementsInfo2KHR; +typedef VkImageMemoryRequirementsInfo2 VkImageMemoryRequirementsInfo2KHR; +typedef VkMemoryRequirements2 VkMemoryRequirements2KHR; +typedef void(VKAPI_PTR* PFN_vkGetImageMemoryRequirements2)(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void(VKAPI_PTR* PFN_vkGetBufferMemoryRequirements2)(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef PFN_vkGetImageMemoryRequirements2 PFN_vkGetImageMemoryRequirements2KHR; +typedef PFN_vkGetBufferMemoryRequirements2 PFN_vkGetBufferMemoryRequirements2KHR; +#endif // VK_KHR_get_memory_requirements2 + +#ifndef VK_KHR_dedicated_allocation +#define VK_KHR_dedicated_allocation 1 +#define VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS (VkStructureType)1000127000 +#define VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO (VkStructureType)1000127001 +#define VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS +#define VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO +typedef struct VkMemoryDedicatedRequirements +{ + VkStructureType sType; + void* pNext; + VkBool32 prefersDedicatedAllocation; + VkBool32 requiresDedicatedAllocation; +} VkMemoryDedicatedRequirements; +typedef struct VkMemoryDedicatedAllocateInfo +{ + VkStructureType sType; + const void* pNext; + VkImage image; + VkBuffer buffer; +} VkMemoryDedicatedAllocateInfo; +typedef VkMemoryDedicatedRequirements VkMemoryDedicatedRequirementsKHR; +typedef VkMemoryDedicatedAllocateInfo VkMemoryDedicatedAllocateInfoKHR; +#endif // VK_KHR_dedicated_allocation + +#ifndef VK_KHR_16bit_storage +#define VK_KHR_16bit_storage 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES (VkStructureType)1000083000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES +typedef struct VkPhysicalDevice16BitStorageFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 storageBuffer16BitAccess; + VkBool32 uniformAndStorageBuffer16BitAccess; + VkBool32 storagePushConstant16; + VkBool32 storageInputOutput16; +} VkPhysicalDevice16BitStorageFeatures; +typedef VkPhysicalDevice16BitStorageFeatures VkPhysicalDevice16BitStorageFeaturesKHR; +#endif // VK_KHR_16bit_storage + +#ifndef VK_KHR_bind_memory2 +#define VK_KHR_bind_memory2 1 +#define VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO (VkStructureType)1000157000 +#define VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO (VkStructureType)1000157001 +#define VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO +#define VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO +typedef struct VkBindBufferMemoryInfo +{ + VkStructureType sType; + const void* pNext; + VkBuffer buffer; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; +} VkBindBufferMemoryInfo; +typedef struct VkBindImageMemoryInfo +{ + VkStructureType sType; + const void* pNext; + VkImage image; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; +} VkBindImageMemoryInfo; +typedef VkBindBufferMemoryInfo VkBindBufferMemoryInfoKHR; +typedef VkBindImageMemoryInfo VkBindImageMemoryInfoKHR; +typedef VkResult(VKAPI_PTR* PFN_vkBindBufferMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos); +typedef VkResult(VKAPI_PTR* PFN_vkBindImageMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos); +typedef PFN_vkBindBufferMemory2 PFN_vkBindBufferMemory2KHR; +typedef PFN_vkBindImageMemory2 PFN_vkBindImageMemory2KHR; +#endif // VK_KHR_bind_memory2 + +#ifndef VK_KHR_sampler_ycbcr_conversion +#define VK_KHR_sampler_ycbcr_conversion 1 +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO (VkStructureType)1000156000 +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO (VkStructureType)1000156001 +#define VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO (VkStructureType)1000156002 +#define VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO (VkStructureType)1000156003 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES (VkStructureType)1000156004 +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES (VkStructureType)1000156005 +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO +#define VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO +#define VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES +#define VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) +typedef VkSamplerYcbcrConversion VkSamplerYcbcrConversionKHR; +typedef enum VkSamplerYcbcrModelConversion +{ + VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY = 0, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY = 1, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709 = 2, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 = 3, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 = 4, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020, + VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM = 0x7FFFFFFF +} VkSamplerYcbcrModelConversion; +typedef enum VkSamplerYcbcrRange +{ + VK_SAMPLER_YCBCR_RANGE_ITU_FULL = 0, + VK_SAMPLER_YCBCR_RANGE_ITU_NARROW = 1, + VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, + VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW, + VK_SAMPLER_YCBCR_RANGE_MAX_ENUM = 0x7FFFFFFF +} VkSamplerYcbcrRange; +typedef enum VkChromaLocation +{ + VK_CHROMA_LOCATION_COSITED_EVEN = 0, + VK_CHROMA_LOCATION_MIDPOINT = 1, + VK_CHROMA_LOCATION_COSITED_EVEN_KHR = VK_CHROMA_LOCATION_COSITED_EVEN, + VK_CHROMA_LOCATION_MIDPOINT_KHR = VK_CHROMA_LOCATION_MIDPOINT, + VK_CHROMA_LOCATION_MAX_ENUM = 0x7FFFFFFF +} VkChromaLocation; +typedef struct VkSamplerYcbcrConversionCreateInfo +{ + VkStructureType sType; + const void* pNext; + VkFormat format; + VkSamplerYcbcrModelConversion ycbcrModel; + VkSamplerYcbcrRange ycbcrRange; + VkComponentMapping components; + VkChromaLocation xChromaOffset; + VkChromaLocation yChromaOffset; + VkFilter chromaFilter; + VkBool32 forceExplicitReconstruction; +} VkSamplerYcbcrConversionCreateInfo; +typedef struct VkSamplerYcbcrConversionInfo +{ + VkStructureType sType; + const void* pNext; + VkSamplerYcbcrConversion conversion; +} VkSamplerYcbcrConversionInfo; +typedef struct VkBindImagePlaneMemoryInfo +{ + VkStructureType sType; + const void* pNext; + VkImageAspectFlagBits planeAspect; +} VkBindImagePlaneMemoryInfo; +typedef struct VkImagePlaneMemoryRequirementsInfo +{ + VkStructureType sType; + const void* pNext; + VkImageAspectFlagBits planeAspect; +} VkImagePlaneMemoryRequirementsInfo; +typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 samplerYcbcrConversion; +} VkPhysicalDeviceSamplerYcbcrConversionFeatures; +typedef struct VkSamplerYcbcrConversionImageFormatProperties +{ + VkStructureType sType; + void* pNext; + uint32_t combinedImageSamplerDescriptorCount; +} VkSamplerYcbcrConversionImageFormatProperties; +typedef VkSamplerYcbcrModelConversion VkSamplerYcbcrModelConversionKHR; +typedef VkSamplerYcbcrRange VkSamplerYcbcrRangeKHR; +typedef VkChromaLocation VkChromaLocationKHR; +typedef VkSamplerYcbcrConversionCreateInfo VkSamplerYcbcrConversionCreateInfoKHR; +typedef VkSamplerYcbcrConversionInfo VkSamplerYcbcrConversionInfoKHR; +typedef VkBindImagePlaneMemoryInfo VkBindImagePlaneMemoryInfoKHR; +typedef VkImagePlaneMemoryRequirementsInfo VkImagePlaneMemoryRequirementsInfoKHR; +typedef VkPhysicalDeviceSamplerYcbcrConversionFeatures VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR; +typedef VkSamplerYcbcrConversionImageFormatProperties VkSamplerYcbcrConversionImageFormatPropertiesKHR; +typedef VkResult(VKAPI_PTR* PFN_vkCreateSamplerYcbcrConversion)(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion); +typedef void(VKAPI_PTR* PFN_vkDestroySamplerYcbcrConversion)(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator); +typedef PFN_vkCreateSamplerYcbcrConversion PFN_vkCreateSamplerYcbcrConversionKHR; +typedef PFN_vkDestroySamplerYcbcrConversion PFN_vkDestroySamplerYcbcrConversionKHR; +#endif // VK_KHR_sampler_ycbcr_conversion + +#if VK_HEADER_VERSION < 70 +// the unpublished VK_KHR_subgroup +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES (VkStructureType)1000094000 +typedef enum VkSubgroupFeatureFlagBits +{ + VK_SUBGROUP_FEATURE_BASIC_BIT = 0x00000001, + VK_SUBGROUP_FEATURE_VOTE_BIT = 0x00000002, + VK_SUBGROUP_FEATURE_ARITHMETIC_BIT = 0x00000004, + VK_SUBGROUP_FEATURE_BALLOT_BIT = 0x00000008, + VK_SUBGROUP_FEATURE_SHUFFLE_BIT = 0x00000010, + VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = 0x00000020, + VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 0x00000040, + VK_SUBGROUP_FEATURE_QUAD_BIT = 0x00000080, + VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100, + VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSubgroupFeatureFlagBits; +typedef VkFlags VkSubgroupFeatureFlags; +typedef struct VkPhysicalDeviceSubgroupProperties +{ + VkStructureType sType; + void* pNext; + uint32_t subgroupSize; + VkShaderStageFlags supportedStages; + VkSubgroupFeatureFlags supportedOperations; + VkBool32 quadOperationsInAllStages; +} VkPhysicalDeviceSubgroupProperties; + +// the unpublished VK_KHR_protected_memory +#define VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO (VkStructureType)1000145000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES (VkStructureType)1000145001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES (VkStructureType)1000145002 +#define VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2 (VkStructureType)1000145003 +#define VK_MEMORY_PROPERTY_PROTECTED_BIT (VkMemoryPropertyFlagBits)0x00000020 +#define VK_IMAGE_CREATE_PROTECTED_BIT (VkImageCreateFlagBits)0x00000800 +#define VK_BUFFER_CREATE_PROTECTED_BIT (VkBufferCreateFlagBits)0x00000008 +#define VK_QUEUE_PROTECTED_BIT (VkQueueFlagBits)0x00000010 +#define VK_COMMAND_POOL_CREATE_PROTECTED_BIT (VkCommandPoolCreateFlagBits)0x00000004 +typedef enum VkDeviceQueueCreateFlagBits +{ + VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT = 0x00000001, + VK_DEVICE_QUEUE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDeviceQueueCreateFlagBits; +typedef VkFlags VkDeviceQueueCreateFlags; +typedef struct VkPhysicalDeviceProtectedMemoryFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 protectedMemory; +} VkPhysicalDeviceProtectedMemoryFeatures; +typedef struct VkPhysicalDeviceProtectedMemoryProperties +{ + VkStructureType sType; + void* pNext; + VkBool32 protectedNoFault; +} VkPhysicalDeviceProtectedMemoryProperties; +typedef struct VkProtectedSubmitInfo +{ + VkStructureType sType; + const void* pNext; + VkBool32 protectedSubmit; +} VkProtectedSubmitInfo; +#endif // VK_HEADER_VERSION < 70 + +#if VK_HEADER_VERSION < 204 +typedef uint64_t VkFlags64; +#endif // VK_HEADER_VERSION < 204 + +#ifndef VK_KHR_format_feature_flags2 +#define VK_KHR_format_feature_flags2 1 +#define VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3 (VkStructureType)1000360000 +#define VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3 +typedef VkFlags64 VkFormatFeatureFlags2; +typedef VkFlags64 VkFormatFeatureFlagBits2; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT = 0x00000001ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR = 0x00000001ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT = 0x00000002ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR = 0x00000002ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHR = 0x00000004ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR = 0x00000008ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT = 0x00000010ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR = 0x00000010ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHR = 0x00000020ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT = 0x00000040ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHR = 0x00000040ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT = 0x00000080ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR = 0x00000080ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHR = 0x00000100ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR = 0x00000200ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT = 0x00000400ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR = 0x00000400ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT = 0x00000800ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT_KHR = 0x00000800ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHR = 0x00001000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT = 0x00002000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT = 0x00004000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR = 0x00004000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT = 0x00008000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR = 0x00008000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 0x00010000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHR = 0x00010000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT = 0x00020000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = 0x00020000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 0x00040000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = 0x00040000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 0x00080000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = 0x00080000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 0x00100000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = 0x00100000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 0x00200000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = 0x00200000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT = 0x00400000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT_KHR = 0x00400000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT = 0x00800000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHR = 0x00800000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT = 0x80000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR = 0x80000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT = 0x100000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR = 0x100000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT = 0x200000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR = 0x200000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV = 0x4000000000ULL; +typedef struct VkFormatProperties3 +{ + VkStructureType sType; + void* pNext; + VkFormatFeatureFlags2 linearTilingFeatures; + VkFormatFeatureFlags2 optimalTilingFeatures; + VkFormatFeatureFlags2 bufferFeatures; +} VkFormatProperties3; +typedef VkFormatFeatureFlags2 VkFormatFeatureFlags2KHR; +typedef VkFormatFeatureFlagBits2 VkFormatFeatureFlagBits2KHR; +typedef VkFormatProperties3 VkFormatProperties3KHR; +#endif // VK_KHR_format_feature_flags2 + +#ifndef VK_ANDROID_external_memory_android_hardware_buffer +#define VK_ANDROID_external_memory_android_hardware_buffer 1 +#define VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID (VkStructureType)1000129000 +#define VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID (VkStructureType)1000129001 +#define VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID (VkStructureType)1000129002 +#define VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID (VkStructureType)1000129003 +#define VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID (VkStructureType)1000129004 +#define VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID (VkStructureType)1000129005 +#define VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID (VkStructureType)1000129006 +struct AHardwareBuffer; +typedef struct VkAndroidHardwareBufferUsageANDROID +{ + VkStructureType sType; + void* pNext; + uint64_t androidHardwareBufferUsage; +} VkAndroidHardwareBufferUsageANDROID; +typedef struct VkAndroidHardwareBufferPropertiesANDROID +{ + VkStructureType sType; + void* pNext; + VkDeviceSize allocationSize; + uint32_t memoryTypeBits; +} VkAndroidHardwareBufferPropertiesANDROID; +typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID +{ + VkStructureType sType; + void* pNext; + VkFormat format; + uint64_t externalFormat; + VkFormatFeatureFlags formatFeatures; + VkComponentMapping samplerYcbcrConversionComponents; + VkSamplerYcbcrModelConversion suggestedYcbcrModel; + VkSamplerYcbcrRange suggestedYcbcrRange; + VkChromaLocation suggestedXChromaOffset; + VkChromaLocation suggestedYChromaOffset; +} VkAndroidHardwareBufferFormatPropertiesANDROID; +typedef struct VkImportAndroidHardwareBufferInfoANDROID +{ + VkStructureType sType; + const void* pNext; + struct AHardwareBuffer* buffer; +} VkImportAndroidHardwareBufferInfoANDROID; +typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID +{ + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; +} VkMemoryGetAndroidHardwareBufferInfoANDROID; +typedef struct VkExternalFormatANDROID +{ + VkStructureType sType; + void* pNext; + uint64_t externalFormat; +} VkExternalFormatANDROID; +typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID +{ + VkStructureType sType; + void* pNext; + VkFormat format; + uint64_t externalFormat; + VkFormatFeatureFlags2 formatFeatures; + VkComponentMapping samplerYcbcrConversionComponents; + VkSamplerYcbcrModelConversion suggestedYcbcrModel; + VkSamplerYcbcrRange suggestedYcbcrRange; + VkChromaLocation suggestedXChromaOffset; + VkChromaLocation suggestedYChromaOffset; +} VkAndroidHardwareBufferFormatProperties2ANDROID; +typedef VkResult(VKAPI_PTR* PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer); +#endif // VK_ANDROID_external_memory_android_hardware_buffer + +#ifndef VK_KHR_maintenance3 +#define VK_KHR_maintenance3 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES (VkStructureType)1000168000 +#define VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT (VkStructureType)1000168001 +typedef struct VkPhysicalDeviceMaintenance3Properties +{ + VkStructureType sType; + void* pNext; + uint32_t maxPerSetDescriptors; + VkDeviceSize maxMemoryAllocationSize; +} VkPhysicalDeviceMaintenance3Properties; +typedef struct VkDescriptorSetLayoutSupport +{ + VkStructureType sType; + void* pNext; + VkBool32 supported; +} VkDescriptorSetLayoutSupport; +typedef VkPhysicalDeviceMaintenance3Properties VkPhysicalDeviceMaintenance3PropertiesKHR; +typedef VkDescriptorSetLayoutSupport VkDescriptorSetLayoutSupportKHR; +typedef void(VKAPI_PTR* PFN_vkGetDescriptorSetLayoutSupport)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport); +typedef PFN_vkGetDescriptorSetLayoutSupport PFN_vkGetDescriptorSetLayoutSupportKHR; +#endif // VK_KHR_maintenance3 + +#ifndef VK_KHR_8bit_storage +#define VK_KHR_8bit_storage 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES (VkStructureType)1000177000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES +typedef struct VkPhysicalDevice8BitStorageFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 storageBuffer8BitAccess; + VkBool32 uniformAndStorageBuffer8BitAccess; + VkBool32 storagePushConstant8; +} VkPhysicalDevice8BitStorageFeatures; +typedef VkPhysicalDevice8BitStorageFeatures VkPhysicalDevice8BitStorageFeaturesKHR; +#endif // VK_KHR_8bit_storage + +#ifndef VK_KHR_shader_float16_int8 +#define VK_KHR_shader_float16_int8 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES (VkStructureType)1000082000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES +typedef struct VkPhysicalDeviceFloat16Int8FeaturesKHR +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderFloat16; + VkBool32 shaderInt8; +} VkPhysicalDeviceFloat16Int8FeaturesKHR; +#endif // VK_KHR_shader_float16_int8 + +#ifndef VK_EXT_memory_budget +#define VK_EXT_memory_budget 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT (VkStructureType)1000237000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT (VkStructureType)1000238000 +#define VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT (VkStructureType)1000238001 +typedef uint64_t VkDeviceAddress; +typedef struct VkPhysicalDeviceMemoryBudgetPropertiesEXT +{ + VkStructureType sType; + void* pNext; + VkDeviceSize heapBudget[VK_MAX_MEMORY_HEAPS]; + VkDeviceSize heapUsage[VK_MAX_MEMORY_HEAPS]; +} VkPhysicalDeviceMemoryBudgetPropertiesEXT; +typedef struct VkPhysicalDeviceMemoryPriorityFeaturesEXT +{ + VkStructureType sType; + void* pNext; + VkBool32 memoryPriority; +} VkPhysicalDeviceMemoryPriorityFeaturesEXT; +typedef struct VkMemoryPriorityAllocateInfoEXT +{ + VkStructureType sType; + const void* pNext; + float priority; +} VkMemoryPriorityAllocateInfoEXT; +#endif // VK_EXT_memory_budget + +#ifndef VK_EXT_buffer_device_address +#define VK_EXT_buffer_device_address 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT (VkStructureType)1000244000 +#define VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT (VkStructureType)1000244001 +#define VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT (VkStructureType)1000244002 +#define VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT (VkBufferUsageFlagBits)0x00020000 +typedef struct VkPhysicalDeviceBufferAddressFeaturesEXT +{ + VkStructureType sType; + void* pNext; + VkBool32 bufferDeviceAddress; + VkBool32 bufferDeviceAddressCaptureReplay; + VkBool32 bufferDeviceAddressMultiDevice; +} VkPhysicalDeviceBufferAddressFeaturesEXT; +typedef struct VkBufferDeviceAddressInfoEXT +{ + VkStructureType sType; + const void* pNext; + VkBuffer buffer; +} VkBufferDeviceAddressInfoEXT; +typedef struct VkBufferDeviceAddressCreateInfoEXT +{ + VkStructureType sType; + const void* pNext; + VkDeviceSize deviceAddress; +} VkBufferDeviceAddressCreateInfoEXT; +typedef VkDeviceAddress(VKAPI_PTR* PFN_vkGetBufferDeviceAddressEXT)(VkDevice device, const VkBufferDeviceAddressInfoEXT* pInfo); +#endif // VK_EXT_buffer_device_address + +#ifndef VK_EXT_validation_features +#define VK_EXT_validation_features 1 +#define VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT (VkStructureType)1000247000 +#define VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT (VkBufferCreateFlagBits)0x00020000 +typedef enum VkValidationFeatureEnableEXT +{ + VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT = 0, + VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT = 1, + VK_VALIDATION_FEATURE_ENABLE_BEGIN_RANGE_EXT = VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT, + VK_VALIDATION_FEATURE_ENABLE_END_RANGE_EXT = VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT, + VK_VALIDATION_FEATURE_ENABLE_RANGE_SIZE_EXT = (VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT - VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT + 1), + VK_VALIDATION_FEATURE_ENABLE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationFeatureEnableEXT; +typedef enum VkValidationFeatureDisableEXT +{ + VK_VALIDATION_FEATURE_DISABLE_ALL_EXT = 0, + VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT = 1, + VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT = 2, + VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT = 3, + VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT = 4, + VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT = 5, + VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT = 6, + VK_VALIDATION_FEATURE_DISABLE_BEGIN_RANGE_EXT = VK_VALIDATION_FEATURE_DISABLE_ALL_EXT, + VK_VALIDATION_FEATURE_DISABLE_END_RANGE_EXT = VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT, + VK_VALIDATION_FEATURE_DISABLE_RANGE_SIZE_EXT = (VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT - VK_VALIDATION_FEATURE_DISABLE_ALL_EXT + 1), + VK_VALIDATION_FEATURE_DISABLE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkValidationFeatureDisableEXT; +typedef struct VkValidationFeaturesEXT +{ + VkStructureType sType; + const void* pNext; + uint32_t enabledValidationFeatureCount; + const VkValidationFeatureEnableEXT* pEnabledValidationFeatures; + uint32_t disabledValidationFeatureCount; + const VkValidationFeatureDisableEXT* pDisabledValidationFeatures; +} VkValidationFeaturesEXT; +#endif // VK_EXT_validation_features + +#ifndef VK_NV_cooperative_matrix +#define VK_NV_cooperative_matrix 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV (VkStructureType)1000249000 +#define VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV (VkStructureType)1000249001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV (VkStructureType)1000249002 +typedef enum VkComponentTypeNV +{ + VK_COMPONENT_TYPE_FLOAT16_NV = 0, + VK_COMPONENT_TYPE_FLOAT32_NV = 1, + VK_COMPONENT_TYPE_FLOAT64_NV = 2, + VK_COMPONENT_TYPE_SINT8_NV = 3, + VK_COMPONENT_TYPE_SINT16_NV = 4, + VK_COMPONENT_TYPE_SINT32_NV = 5, + VK_COMPONENT_TYPE_SINT64_NV = 6, + VK_COMPONENT_TYPE_UINT8_NV = 7, + VK_COMPONENT_TYPE_UINT16_NV = 8, + VK_COMPONENT_TYPE_UINT32_NV = 9, + VK_COMPONENT_TYPE_UINT64_NV = 10, + VK_COMPONENT_TYPE_BEGIN_RANGE_NV = VK_COMPONENT_TYPE_FLOAT16_NV, + VK_COMPONENT_TYPE_END_RANGE_NV = VK_COMPONENT_TYPE_UINT64_NV, + VK_COMPONENT_TYPE_RANGE_SIZE_NV = (VK_COMPONENT_TYPE_UINT64_NV - VK_COMPONENT_TYPE_FLOAT16_NV + 1), + VK_COMPONENT_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkComponentTypeNV; +typedef enum VkScopeNV +{ + VK_SCOPE_DEVICE_NV = 1, + VK_SCOPE_WORKGROUP_NV = 2, + VK_SCOPE_SUBGROUP_NV = 3, + VK_SCOPE_QUEUE_FAMILY_NV = 5, + VK_SCOPE_BEGIN_RANGE_NV = VK_SCOPE_DEVICE_NV, + VK_SCOPE_END_RANGE_NV = VK_SCOPE_QUEUE_FAMILY_NV, + VK_SCOPE_RANGE_SIZE_NV = (VK_SCOPE_QUEUE_FAMILY_NV - VK_SCOPE_DEVICE_NV + 1), + VK_SCOPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkScopeNV; +typedef struct VkCooperativeMatrixPropertiesNV +{ + VkStructureType sType; + void* pNext; + uint32_t MSize; + uint32_t NSize; + uint32_t KSize; + VkComponentTypeNV AType; + VkComponentTypeNV BType; + VkComponentTypeNV CType; + VkComponentTypeNV DType; + VkScopeNV scope; +} VkCooperativeMatrixPropertiesNV; +typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesNV +{ + VkStructureType sType; + void* pNext; + VkBool32 cooperativeMatrix; + VkBool32 cooperativeMatrixRobustBufferAccess; +} VkPhysicalDeviceCooperativeMatrixFeaturesNV; +typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesNV +{ + VkStructureType sType; + void* pNext; + VkShaderStageFlags cooperativeMatrixSupportedStages; +} VkPhysicalDeviceCooperativeMatrixPropertiesNV; +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesNV* pProperties); +#endif // VK_NV_cooperative_matrix + +#ifndef VK_AMD_device_coherent_memory +#define VK_AMD_device_coherent_memory 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD (VkStructureType)1000229000 +#define VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD (VkMemoryPropertyFlagBits)0x00000040 +#define VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD (VkMemoryPropertyFlagBits)0x00000040 +typedef struct VkPhysicalDeviceCoherentMemoryFeaturesAMD +{ + VkStructureType sType; + void* pNext; + VkBool32 deviceCoherentMemory; +} VkPhysicalDeviceCoherentMemoryFeaturesAMD; +#endif // VK_AMD_device_coherent_memory + +#ifndef VK_KHR_buffer_device_address +#define VK_KHR_buffer_device_address 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES (VkStructureType)1000257000 +#define VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO (VkStructureType)1000244001 +#define VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO (VkStructureType)1000257002 +#define VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO (VkStructureType)1000257003 +#define VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO (VkStructureType)1000257004 +#define VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT (VkBufferCreateFlagBits)0x00020000 +#define VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT (VkBufferUsageFlagBits)0x00020000 +#define VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT (VkMemoryAllocateFlagBits)0x00000002 +#define VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT (VkMemoryAllocateFlagBits)0x00000004 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES +#define VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO +#define VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO +#define VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO +#define VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO +#define VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT +#define VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT +#define VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT +#define VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT +typedef struct VkPhysicalDeviceBufferDeviceAddressFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 bufferDeviceAddress; + VkBool32 bufferDeviceAddressCaptureReplay; + VkBool32 bufferDeviceAddressMultiDevice; +} VkPhysicalDeviceBufferDeviceAddressFeatures; +typedef struct VkBufferDeviceAddressInfo +{ + VkStructureType sType; + const void* pNext; + VkBuffer buffer; +} VkBufferDeviceAddressInfo; +typedef struct VkBufferOpaqueCaptureAddressCreateInfo +{ + VkStructureType sType; + const void* pNext; + uint64_t opaqueCaptureAddress; +} VkBufferOpaqueCaptureAddressCreateInfo; +typedef struct VkMemoryOpaqueCaptureAddressAllocateInfo +{ + VkStructureType sType; + const void* pNext; + uint64_t opaqueCaptureAddress; +} VkMemoryOpaqueCaptureAddressAllocateInfo; +typedef struct VkDeviceMemoryOpaqueCaptureAddressInfo +{ + VkStructureType sType; + const void* pNext; + VkDeviceMemory memory; +} VkDeviceMemoryOpaqueCaptureAddressInfo; +typedef VkPhysicalDeviceBufferDeviceAddressFeatures VkPhysicalDeviceBufferDeviceAddressFeaturesKHR; +typedef VkBufferDeviceAddressInfo VkBufferDeviceAddressInfoKHR; +typedef VkBufferOpaqueCaptureAddressCreateInfo VkBufferOpaqueCaptureAddressCreateInfoKHR; +typedef VkMemoryOpaqueCaptureAddressAllocateInfo VkMemoryOpaqueCaptureAddressAllocateInfoKHR; +typedef VkDeviceMemoryOpaqueCaptureAddressInfo VkDeviceMemoryOpaqueCaptureAddressInfoKHR; +typedef VkDeviceAddress(VKAPI_PTR* PFN_vkGetBufferDeviceAddress)(VkDevice device, const VkBufferDeviceAddressInfo* pInfo); +typedef uint64_t(VKAPI_PTR* PFN_vkGetBufferOpaqueCaptureAddress)(VkDevice device, const VkBufferDeviceAddressInfo* pInfo); +typedef uint64_t(VKAPI_PTR* PFN_vkGetDeviceMemoryOpaqueCaptureAddress)(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo); +typedef PFN_vkGetBufferDeviceAddress PFN_vkGetBufferDeviceAddressKHR; +typedef PFN_vkGetBufferOpaqueCaptureAddress PFN_vkGetBufferOpaqueCaptureAddressKHR; +typedef PFN_vkGetDeviceMemoryOpaqueCaptureAddress PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR; +#endif // VK_KHR_buffer_device_address + +#ifndef VK_KHR_portability_enumeration +#define VK_KHR_portability_enumeration 1 +typedef enum VkInstanceCreateFlagBits +{ + VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR = 0x00000001, + VK_INSTANCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkInstanceCreateFlagBits; +#endif // VK_KHR_portability_enumeration + +#ifndef VK_KHR_cooperative_matrix +#define VK_KHR_cooperative_matrix 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR (VkStructureType)1000506000 +#define VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR (VkStructureType)1000506001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR (VkStructureType)1000506002 +typedef enum VkComponentTypeKHR +{ + VK_COMPONENT_TYPE_FLOAT16_KHR = 0, + VK_COMPONENT_TYPE_FLOAT32_KHR = 1, + VK_COMPONENT_TYPE_FLOAT64_KHR = 2, + VK_COMPONENT_TYPE_SINT8_KHR = 3, + VK_COMPONENT_TYPE_SINT16_KHR = 4, + VK_COMPONENT_TYPE_SINT32_KHR = 5, + VK_COMPONENT_TYPE_SINT64_KHR = 6, + VK_COMPONENT_TYPE_UINT8_KHR = 7, + VK_COMPONENT_TYPE_UINT16_KHR = 8, + VK_COMPONENT_TYPE_UINT32_KHR = 9, + VK_COMPONENT_TYPE_UINT64_KHR = 10, + VK_COMPONENT_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkComponentTypeKHR; +typedef enum VkScopeKHR +{ + VK_SCOPE_DEVICE_KHR = 1, + VK_SCOPE_WORKGROUP_KHR = 2, + VK_SCOPE_SUBGROUP_KHR = 3, + VK_SCOPE_QUEUE_FAMILY_KHR = 5, + VK_SCOPE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkScopeKHR; +typedef struct VkCooperativeMatrixPropertiesKHR +{ + VkStructureType sType; + void* pNext; + uint32_t MSize; + uint32_t NSize; + uint32_t KSize; + VkComponentTypeKHR AType; + VkComponentTypeKHR BType; + VkComponentTypeKHR CType; + VkComponentTypeKHR ResultType; + VkBool32 saturatingAccumulation; + VkScopeKHR scope; +} VkCooperativeMatrixPropertiesKHR; +typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesKHR +{ + VkStructureType sType; + void* pNext; + VkBool32 cooperativeMatrix; + VkBool32 cooperativeMatrixRobustBufferAccess; +} VkPhysicalDeviceCooperativeMatrixFeaturesKHR; +typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesKHR +{ + VkStructureType sType; + void* pNext; + VkShaderStageFlags cooperativeMatrixSupportedStages; +} VkPhysicalDeviceCooperativeMatrixPropertiesKHR; +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesKHR* pProperties); +#endif // VK_KHR_cooperative_matrix + +#ifndef VK_KHR_driver_properties +#define VK_KHR_driver_properties 1 +#define VK_MAX_DRIVER_NAME_SIZE 256U +#define VK_MAX_DRIVER_INFO_SIZE 256U +#define VK_MAX_DRIVER_NAME_SIZE_KHR VK_MAX_DRIVER_NAME_SIZE +#define VK_MAX_DRIVER_INFO_SIZE_KHR VK_MAX_DRIVER_INFO_SIZE +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES (VkStructureType)1000196000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES +typedef enum VkDriverId +{ + VK_DRIVER_ID_AMD_PROPRIETARY = 1, + VK_DRIVER_ID_AMD_OPEN_SOURCE = 2, + VK_DRIVER_ID_MESA_RADV = 3, + VK_DRIVER_ID_NVIDIA_PROPRIETARY = 4, + VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS = 5, + VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA = 6, + VK_DRIVER_ID_IMAGINATION_PROPRIETARY = 7, + VK_DRIVER_ID_QUALCOMM_PROPRIETARY = 8, + VK_DRIVER_ID_ARM_PROPRIETARY = 9, + VK_DRIVER_ID_GOOGLE_SWIFTSHADER = 10, + VK_DRIVER_ID_GGP_PROPRIETARY = 11, + VK_DRIVER_ID_BROADCOM_PROPRIETARY = 12, + VK_DRIVER_ID_MESA_LLVMPIPE = 13, + VK_DRIVER_ID_MOLTENVK = 14, + VK_DRIVER_ID_COREAVI_PROPRIETARY = 15, + VK_DRIVER_ID_JUICE_PROPRIETARY = 16, + VK_DRIVER_ID_VERISILICON_PROPRIETARY = 17, + VK_DRIVER_ID_MESA_TURNIP = 18, + VK_DRIVER_ID_MESA_V3DV = 19, + VK_DRIVER_ID_MESA_PANVK = 20, + VK_DRIVER_ID_SAMSUNG_PROPRIETARY = 21, + VK_DRIVER_ID_MESA_VENUS = 22, + VK_DRIVER_ID_MESA_DOZEN = 23, + VK_DRIVER_ID_MESA_NVK = 24, + VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA = 25, + VK_DRIVER_ID_MESA_AGXV = 26, + VK_DRIVER_ID_MAX_ENUM = 0x7FFFFFFF +} VkDriverId; +typedef struct VkConformanceVersion +{ + uint8_t major; + uint8_t minor; + uint8_t subminor; + uint8_t patch; +} VkConformanceVersion; +typedef struct VkPhysicalDeviceDriverProperties +{ + VkStructureType sType; + void* pNext; + VkDriverId driverID; + char driverName[VK_MAX_DRIVER_NAME_SIZE]; + char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; + VkConformanceVersion conformanceVersion; +} VkPhysicalDeviceDriverProperties; +typedef VkDriverId VkDriverIdKHR; +typedef VkConformanceVersion VkConformanceVersionKHR; +typedef VkPhysicalDeviceDriverProperties VkPhysicalDeviceDriverPropertiesKHR; +#endif // VK_KHR_driver_properties + +#ifndef VK_EXT_subgroup_size_control +#define VK_EXT_subgroup_size_control 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES (VkStructureType)1000225002 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES (VkStructureType)1000225000 +#define VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO (VkStructureType)1000225001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES +#define VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO +typedef enum VkPipelineShaderStageCreateFlagBits +{ + VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT = 0x00000001, + VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT = 0x00000002, + VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT, + VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT = VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT, + VK_PIPELINE_SHADER_STAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkPipelineShaderStageCreateFlagBits; +typedef VkFlags VkPipelineShaderStageCreateFlags; +typedef struct VkPhysicalDeviceSubgroupSizeControlFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 subgroupSizeControl; + VkBool32 computeFullSubgroups; +} VkPhysicalDeviceSubgroupSizeControlFeatures; +typedef struct VkPhysicalDeviceSubgroupSizeControlProperties +{ + VkStructureType sType; + void* pNext; + uint32_t minSubgroupSize; + uint32_t maxSubgroupSize; + uint32_t maxComputeWorkgroupSubgroups; + VkShaderStageFlags requiredSubgroupSizeStages; +} VkPhysicalDeviceSubgroupSizeControlProperties; +typedef struct VkPipelineShaderStageRequiredSubgroupSizeCreateInfo +{ + VkStructureType sType; + void* pNext; + uint32_t requiredSubgroupSize; +} VkPipelineShaderStageRequiredSubgroupSizeCreateInfo; +typedef VkPhysicalDeviceSubgroupSizeControlFeatures VkPhysicalDeviceSubgroupSizeControlFeaturesEXT; +typedef VkPhysicalDeviceSubgroupSizeControlProperties VkPhysicalDeviceSubgroupSizeControlPropertiesEXT; +typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT; +#endif // VK_EXT_subgroup_size_control + +#ifndef VK_KHR_shader_subgroup_rotate +#define VK_KHR_shader_subgroup_rotate 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES (VkStructureType)1000416000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES +#define VK_SUBGROUP_FEATURE_ROTATE_BIT (VkSubgroupFeatureFlagBits)0x00000200 +#define VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT (VkSubgroupFeatureFlagBits)0x00000400 +#define VK_SUBGROUP_FEATURE_ROTATE_BIT_KHR VK_SUBGROUP_FEATURE_ROTATE_BIT +#define VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT_KHR VK_SUBGROUP_FEATURE_ROTATE_CLUSTERED_BIT +typedef struct VkPhysicalDeviceShaderSubgroupRotateFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderSubgroupRotate; + VkBool32 shaderSubgroupRotateClustered; +} VkPhysicalDeviceShaderSubgroupRotateFeatures; +typedef VkPhysicalDeviceShaderSubgroupRotateFeatures VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR; +#endif // VK_KHR_shader_subgroup_rotate + +#ifndef VK_EXT_shader_atomic_float +#define VK_EXT_shader_atomic_float 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT (VkStructureType)1000260000 +typedef struct VkPhysicalDeviceShaderAtomicFloatFeaturesEXT +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderBufferFloat32Atomics; + VkBool32 shaderBufferFloat32AtomicAdd; + VkBool32 shaderBufferFloat64Atomics; + VkBool32 shaderBufferFloat64AtomicAdd; + VkBool32 shaderSharedFloat32Atomics; + VkBool32 shaderSharedFloat32AtomicAdd; + VkBool32 shaderSharedFloat64Atomics; + VkBool32 shaderSharedFloat64AtomicAdd; + VkBool32 shaderImageFloat32Atomics; + VkBool32 shaderImageFloat32AtomicAdd; + VkBool32 sparseImageFloat32Atomics; + VkBool32 sparseImageFloat32AtomicAdd; +} VkPhysicalDeviceShaderAtomicFloatFeaturesEXT; +#endif // VK_EXT_shader_atomic_float + +#ifndef VK_EXT_shader_atomic_float2 +#define VK_EXT_shader_atomic_float2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT (VkStructureType)1000273000 +typedef struct VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderBufferFloat16Atomics; + VkBool32 shaderBufferFloat16AtomicAdd; + VkBool32 shaderBufferFloat16AtomicMinMax; + VkBool32 shaderBufferFloat32AtomicMinMax; + VkBool32 shaderBufferFloat64AtomicMinMax; + VkBool32 shaderSharedFloat16Atomics; + VkBool32 shaderSharedFloat16AtomicAdd; + VkBool32 shaderSharedFloat16AtomicMinMax; + VkBool32 shaderSharedFloat32AtomicMinMax; + VkBool32 shaderSharedFloat64AtomicMinMax; + VkBool32 shaderImageFloat32AtomicMinMax; + VkBool32 sparseImageFloat32AtomicMinMax; +} VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT; +#endif // VK_EXT_shader_atomic_float2 + +#ifndef VK_KHR_shader_integer_dot_product +#define VK_KHR_shader_integer_dot_product 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES (VkStructureType)1000280000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES (VkStructureType)1000280001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES +typedef struct VkPhysicalDeviceShaderIntegerDotProductFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderIntegerDotProduct; +} VkPhysicalDeviceShaderIntegerDotProductFeatures; +typedef struct VkPhysicalDeviceShaderIntegerDotProductProperties +{ + VkStructureType sType; + void* pNext; + VkBool32 integerDotProduct8BitUnsignedAccelerated; + VkBool32 integerDotProduct8BitSignedAccelerated; + VkBool32 integerDotProduct8BitMixedSignednessAccelerated; + VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated; + VkBool32 integerDotProduct4x8BitPackedSignedAccelerated; + VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated; + VkBool32 integerDotProduct16BitUnsignedAccelerated; + VkBool32 integerDotProduct16BitSignedAccelerated; + VkBool32 integerDotProduct16BitMixedSignednessAccelerated; + VkBool32 integerDotProduct32BitUnsignedAccelerated; + VkBool32 integerDotProduct32BitSignedAccelerated; + VkBool32 integerDotProduct32BitMixedSignednessAccelerated; + VkBool32 integerDotProduct64BitUnsignedAccelerated; + VkBool32 integerDotProduct64BitSignedAccelerated; + VkBool32 integerDotProduct64BitMixedSignednessAccelerated; + VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated; + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated; + VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated; + VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated; + VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated; + VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; +} VkPhysicalDeviceShaderIntegerDotProductProperties; +typedef VkPhysicalDeviceShaderIntegerDotProductFeatures VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR; +typedef VkPhysicalDeviceShaderIntegerDotProductProperties VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR; +#endif // VK_KHR_shader_integer_dot_product + +#ifndef VK_KHR_robustness2 +#define VK_KHR_robustness2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_KHR (VkStructureType)1000286000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_KHR (VkStructureType)1000286001 +typedef struct VkPhysicalDeviceRobustness2FeaturesKHR +{ + VkStructureType sType; + void* pNext; + VkBool32 robustBufferAccess2; + VkBool32 robustImageAccess2; + VkBool32 nullDescriptor; +} VkPhysicalDeviceRobustness2FeaturesKHR; +typedef struct VkPhysicalDeviceRobustness2PropertiesKHR +{ + VkStructureType sType; + void* pNext; + VkDeviceSize robustStorageBufferAccessSizeAlignment; + VkDeviceSize robustUniformBufferAccessSizeAlignment; +} VkPhysicalDeviceRobustness2PropertiesKHR; +#endif // VK_KHR_robustness2 + +#ifndef VK_EXT_robustness2 +#define VK_EXT_robustness2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_KHR +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_KHR +typedef VkPhysicalDeviceRobustness2FeaturesKHR VkPhysicalDeviceRobustness2FeaturesEXT; +typedef VkPhysicalDeviceRobustness2PropertiesKHR VkPhysicalDeviceRobustness2PropertiesEXT; +#endif // VK_EXT_robustness2 + +#ifndef VK_KHR_shader_bfloat16 +#define VK_KHR_shader_bfloat16 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_BFLOAT16_FEATURES_KHR (VkStructureType)1000141000 +#define VK_COMPONENT_TYPE_BFLOAT16_KHR (VkComponentTypeKHR)1000141000 +typedef struct VkPhysicalDeviceShaderBfloat16FeaturesKHR +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderBFloat16Type; + VkBool32 shaderBFloat16DotProduct; + VkBool32 shaderBFloat16CooperativeMatrix; +} VkPhysicalDeviceShaderBfloat16FeaturesKHR; +#endif // VK_KHR_shader_bfloat16 + +#ifndef VK_KHR_shader_float_controls +#define VK_KHR_shader_float_controls 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES (VkStructureType)1000197000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES +typedef enum VkShaderFloatControlsIndependence +{ + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY = 0, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL = 1, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE = 2, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE_KHR = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE, + VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_MAX_ENUM = 0x7FFFFFFF +} VkShaderFloatControlsIndependence; +typedef struct VkPhysicalDeviceFloatControlsProperties +{ + VkStructureType sType; + void* pNext; + VkShaderFloatControlsIndependence denormBehaviorIndependence; + VkShaderFloatControlsIndependence roundingModeIndependence; + VkBool32 shaderSignedZeroInfNanPreserveFloat16; + VkBool32 shaderSignedZeroInfNanPreserveFloat32; + VkBool32 shaderSignedZeroInfNanPreserveFloat64; + VkBool32 shaderDenormPreserveFloat16; + VkBool32 shaderDenormPreserveFloat32; + VkBool32 shaderDenormPreserveFloat64; + VkBool32 shaderDenormFlushToZeroFloat16; + VkBool32 shaderDenormFlushToZeroFloat32; + VkBool32 shaderDenormFlushToZeroFloat64; + VkBool32 shaderRoundingModeRTEFloat16; + VkBool32 shaderRoundingModeRTEFloat32; + VkBool32 shaderRoundingModeRTEFloat64; + VkBool32 shaderRoundingModeRTZFloat16; + VkBool32 shaderRoundingModeRTZFloat32; + VkBool32 shaderRoundingModeRTZFloat64; +} VkPhysicalDeviceFloatControlsProperties; +typedef VkShaderFloatControlsIndependence VkShaderFloatControlsIndependenceKHR; +typedef VkPhysicalDeviceFloatControlsProperties VkPhysicalDeviceFloatControlsPropertiesKHR; +#endif // VK_KHR_shader_float_controls + +#ifndef VK_KHR_shader_float_controls2 +#define VK_KHR_shader_float_controls2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES (VkStructureType)1000528000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES +typedef struct VkPhysicalDeviceShaderFloatControls2Features +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderFloatControls2; +} VkPhysicalDeviceShaderFloatControls2Features; +typedef VkPhysicalDeviceShaderFloatControls2Features VkPhysicalDeviceShaderFloatControls2FeaturesKHR; +#endif // VK_KHR_shader_float_controls2 + +#ifndef VK_NV_cooperative_vector +#define VK_NV_cooperative_vector 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_VECTOR_FEATURES_NV (VkStructureType)1000491000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_VECTOR_PROPERTIES_NV (VkStructureType)1000491001 +#define VK_STRUCTURE_TYPE_COOPERATIVE_VECTOR_PROPERTIES_NV (VkStructureType)1000491002 +#define VK_STRUCTURE_TYPE_CONVERT_COOPERATIVE_VECTOR_MATRIX_INFO_NV (VkStructureType)1000491004 +#define VK_COMPONENT_TYPE_SINT8_PACKED_NV (VkComponentTypeKHR)1000491000 +#define VK_COMPONENT_TYPE_UINT8_PACKED_NV (VkComponentTypeKHR)1000491001 +#define VK_COMPONENT_TYPE_FLOAT_E4M3_NV (VkComponentTypeKHR)1000491002 +#define VK_COMPONENT_TYPE_FLOAT_E5M2_NV (VkComponentTypeKHR)1000491003 +typedef enum VkCooperativeVectorMatrixLayoutNV +{ + VK_COOPERATIVE_VECTOR_MATRIX_LAYOUT_ROW_MAJOR_NV = 0, + VK_COOPERATIVE_VECTOR_MATRIX_LAYOUT_COLUMN_MAJOR_NV = 1, + VK_COOPERATIVE_VECTOR_MATRIX_LAYOUT_INFERENCING_OPTIMAL_NV = 2, + VK_COOPERATIVE_VECTOR_MATRIX_LAYOUT_TRAINING_OPTIMAL_NV = 3, + VK_COOPERATIVE_VECTOR_MATRIX_LAYOUT_MAX_ENUM_NV = 0x7FFFFFFF +} VkCooperativeVectorMatrixLayoutNV; +#ifndef VK_KHR_acceleration_structure +typedef union VkDeviceOrHostAddressConstKHR +{ + VkDeviceAddress deviceAddress; + const void* hostAddress; +} VkDeviceOrHostAddressConstKHR; +typedef union VkDeviceOrHostAddressKHR +{ + VkDeviceAddress deviceAddress; + void* hostAddress; +} VkDeviceOrHostAddressKHR; +#endif // VK_KHR_acceleration_structure +typedef struct VkPhysicalDeviceCooperativeVectorPropertiesNV +{ + VkStructureType sType; + void* pNext; + VkShaderStageFlags cooperativeVectorSupportedStages; + VkBool32 cooperativeVectorTrainingFloat16Accumulation; + VkBool32 cooperativeVectorTrainingFloat32Accumulation; + uint32_t maxCooperativeVectorComponents; +} VkPhysicalDeviceCooperativeVectorPropertiesNV; +typedef struct VkPhysicalDeviceCooperativeVectorFeaturesNV +{ + VkStructureType sType; + void* pNext; + VkBool32 cooperativeVector; + VkBool32 cooperativeVectorTraining; +} VkPhysicalDeviceCooperativeVectorFeaturesNV; +typedef struct VkCooperativeVectorPropertiesNV +{ + VkStructureType sType; + void* pNext; + VkComponentTypeKHR inputType; + VkComponentTypeKHR inputInterpretation; + VkComponentTypeKHR matrixInterpretation; + VkComponentTypeKHR biasInterpretation; + VkComponentTypeKHR resultType; + VkBool32 transpose; +} VkCooperativeVectorPropertiesNV; +typedef struct VkConvertCooperativeVectorMatrixInfoNV +{ + VkStructureType sType; + const void* pNext; + size_t srcSize; + VkDeviceOrHostAddressConstKHR srcData; + size_t* pDstSize; + VkDeviceOrHostAddressKHR dstData; + VkComponentTypeKHR srcComponentType; + VkComponentTypeKHR dstComponentType; + uint32_t numRows; + uint32_t numColumns; + VkCooperativeVectorMatrixLayoutNV srcLayout; + size_t srcStride; + VkCooperativeVectorMatrixLayoutNV dstLayout; + size_t dstStride; +} VkConvertCooperativeVectorMatrixInfoNV; +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceCooperativeVectorPropertiesNV)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeVectorPropertiesNV* pProperties); +typedef VkResult(VKAPI_PTR* PFN_vkConvertCooperativeVectorMatrixNV)(VkDevice device, const VkConvertCooperativeVectorMatrixInfoNV* pInfo); +typedef void(VKAPI_PTR* PFN_vkCmdConvertCooperativeVectorMatrixNV)(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkConvertCooperativeVectorMatrixInfoNV* pInfos); +#endif // VK_NV_cooperative_vector + +#ifndef VK_NV_cooperative_matrix2 +#define VK_NV_cooperative_matrix2 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV (VkStructureType)1000593000 +#define VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_FLEXIBLE_DIMENSIONS_PROPERTIES_NV (VkStructureType)1000593001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV (VkStructureType)1000593002 +typedef struct VkCooperativeMatrixFlexibleDimensionsPropertiesNV +{ + VkStructureType sType; + void* pNext; + uint32_t MGranularity; + uint32_t NGranularity; + uint32_t KGranularity; + VkComponentTypeKHR AType; + VkComponentTypeKHR BType; + VkComponentTypeKHR CType; + VkComponentTypeKHR ResultType; + VkBool32 saturatingAccumulation; + VkScopeKHR scope; + uint32_t workgroupInvocations; +} VkCooperativeMatrixFlexibleDimensionsPropertiesNV; +typedef struct VkPhysicalDeviceCooperativeMatrix2FeaturesNV +{ + VkStructureType sType; + void* pNext; + VkBool32 cooperativeMatrixWorkgroupScope; + VkBool32 cooperativeMatrixFlexibleDimensions; + VkBool32 cooperativeMatrixReductions; + VkBool32 cooperativeMatrixConversions; + VkBool32 cooperativeMatrixPerElementOperations; + VkBool32 cooperativeMatrixTensorAddressing; + VkBool32 cooperativeMatrixBlockLoads; +} VkPhysicalDeviceCooperativeMatrix2FeaturesNV; +typedef struct VkPhysicalDeviceCooperativeMatrix2PropertiesNV +{ + VkStructureType sType; + void* pNext; + uint32_t cooperativeMatrixWorkgroupScopeMaxWorkgroupSize; + uint32_t cooperativeMatrixFlexibleDimensionsMaxDimension; + uint32_t cooperativeMatrixWorkgroupScopeReservedSharedMemory; +} VkPhysicalDeviceCooperativeMatrix2PropertiesNV; +typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixFlexibleDimensionsPropertiesNV* pProperties); +#endif // VK_NV_cooperative_matrix2 + +#ifndef VK_EXT_shader_float8 +#define VK_EXT_shader_float8 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT8_FEATURES_EXT (VkStructureType)1000567000 +#define VK_COMPONENT_TYPE_FLOAT8_E4M3_EXT (VkComponentTypeKHR)1000491002 +#define VK_COMPONENT_TYPE_FLOAT8_E5M2_EXT (VkComponentTypeKHR)1000491003 +typedef struct VkPhysicalDeviceShaderFloat8FeaturesEXT +{ + VkStructureType sType; + void* pNext; + VkBool32 shaderFloat8; + VkBool32 shaderFloat8CooperativeMatrix; +} VkPhysicalDeviceShaderFloat8FeaturesEXT; +#endif // VK_EXT_shader_float8 + +#ifndef VK_KHR_vulkan_memory_model +#define VK_KHR_vulkan_memory_model 1 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES (VkStructureType)1000211000 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES +typedef struct VkPhysicalDeviceVulkanMemoryModelFeatures +{ + VkStructureType sType; + void* pNext; + VkBool32 vulkanMemoryModel; + VkBool32 vulkanMemoryModelDeviceScope; + VkBool32 vulkanMemoryModelAvailabilityVisibilityChains; +} VkPhysicalDeviceVulkanMemoryModelFeatures; +typedef VkPhysicalDeviceVulkanMemoryModelFeatures VkPhysicalDeviceVulkanMemoryModelFeaturesKHR; +#endif // VK_KHR_vulkan_memory_model + +#ifndef VK_EXT_external_memory_host +#define VK_EXT_external_memory_host 1 +#define VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT (VkStructureType)1000178000 +#define VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT (VkStructureType)1000178001 +#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT (VkStructureType)1000178002 +typedef struct VkImportMemoryHostPointerInfoEXT +{ + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBits handleType; + void* pHostPointer; +} VkImportMemoryHostPointerInfoEXT; +typedef struct VkMemoryHostPointerPropertiesEXT +{ + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryHostPointerPropertiesEXT; +typedef struct VkPhysicalDeviceExternalMemoryHostPropertiesEXT +{ + VkStructureType sType; + void* pNext; + VkDeviceSize minImportedHostPointerAlignment; +} VkPhysicalDeviceExternalMemoryHostPropertiesEXT; +typedef VkResult(VKAPI_PTR* PFN_vkGetMemoryHostPointerPropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); +#endif // VK_EXT_external_memory_host + +#endif // NCNN_VULKAN_HEADER_FIX_H diff --git a/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-config-version.cmake b/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-config-version.cmake new file mode 100644 index 0000000..4bac572 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-config-version.cmake @@ -0,0 +1,65 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, +# but only if the requested major version is the same as the current one. +# The variable CVF_VERSION must be set before calling configure_file(). + + +set(PACKAGE_VERSION "16.1.0") + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + + if("16.1.0" MATCHES "^([0-9]+)\\.") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) + string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") + endif() + else() + set(CVF_VERSION_MAJOR "16.1.0") + endif() + + if(PACKAGE_FIND_VERSION_RANGE) + # both endpoints of the range must have the expected major version + math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1") + if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR + AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + else() + if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "4" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "4") + math(EXPR installedBits "4 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-config.cmake b/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-config.cmake new file mode 100644 index 0000000..57609a6 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-config.cmake @@ -0,0 +1,34 @@ + +####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### +####### Any changes to this file will be overwritten by the next CMake run #### +####### The input file was glslang-config.cmake.in ######## + +get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) + +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +#################################################################################### + include(CMakeFindDependencyMacro) + if(OFF) + find_dependency(SPIRV-Tools-opt) + endif() + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_dependency(Threads) + + include("${PACKAGE_PREFIX_DIR}/lib/cmake/glslang/glslang-targets.cmake") + diff --git a/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-targets-release.cmake b/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-targets-release.cmake new file mode 100644 index 0000000..6eac5b4 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-targets-release.cmake @@ -0,0 +1,69 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Release". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "glslang::SPIRV" for configuration "Release" +set_property(TARGET glslang::SPIRV APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::SPIRV PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libSPIRV.a" + ) + +list(APPEND _cmake_import_check_targets glslang::SPIRV ) +list(APPEND _cmake_import_check_files_for_glslang::SPIRV "${_IMPORT_PREFIX}/lib/libSPIRV.a" ) + +# Import target "glslang::OSDependent" for configuration "Release" +set_property(TARGET glslang::OSDependent APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::OSDependent PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOSDependent.a" + ) + +list(APPEND _cmake_import_check_targets glslang::OSDependent ) +list(APPEND _cmake_import_check_files_for_glslang::OSDependent "${_IMPORT_PREFIX}/lib/libOSDependent.a" ) + +# Import target "glslang::glslang" for configuration "Release" +set_property(TARGET glslang::glslang APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::glslang PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libglslang.a" + ) + +list(APPEND _cmake_import_check_targets glslang::glslang ) +list(APPEND _cmake_import_check_files_for_glslang::glslang "${_IMPORT_PREFIX}/lib/libglslang.a" ) + +# Import target "glslang::MachineIndependent" for configuration "Release" +set_property(TARGET glslang::MachineIndependent APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::MachineIndependent PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libMachineIndependent.a" + ) + +list(APPEND _cmake_import_check_targets glslang::MachineIndependent ) +list(APPEND _cmake_import_check_files_for_glslang::MachineIndependent "${_IMPORT_PREFIX}/lib/libMachineIndependent.a" ) + +# Import target "glslang::GenericCodeGen" for configuration "Release" +set_property(TARGET glslang::GenericCodeGen APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::GenericCodeGen PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libGenericCodeGen.a" + ) + +list(APPEND _cmake_import_check_targets glslang::GenericCodeGen ) +list(APPEND _cmake_import_check_files_for_glslang::GenericCodeGen "${_IMPORT_PREFIX}/lib/libGenericCodeGen.a" ) + +# Import target "glslang::glslang-default-resource-limits" for configuration "Release" +set_property(TARGET glslang::glslang-default-resource-limits APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(glslang::glslang-default-resource-limits PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libglslang-default-resource-limits.a" + ) + +list(APPEND _cmake_import_check_targets glslang::glslang-default-resource-limits ) +list(APPEND _cmake_import_check_files_for_glslang::glslang-default-resource-limits "${_IMPORT_PREFIX}/lib/libglslang-default-resource-limits.a" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-targets.cmake b/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-targets.cmake new file mode 100644 index 0000000..31bc95c --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/lib/cmake/glslang/glslang-targets.cmake @@ -0,0 +1,135 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.12 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.12") + message(FATAL_ERROR "CMake >= 2.8.12 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.12...3.29) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS glslang::SPIRV glslang::OSDependent glslang::glslang glslang::MachineIndependent glslang::GenericCodeGen glslang::glslang-default-resource-limits) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target glslang::SPIRV +add_library(glslang::SPIRV STATIC IMPORTED) + +set_target_properties(glslang::SPIRV PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "glslang::glslang" +) + +# Create imported target glslang::OSDependent +add_library(glslang::OSDependent STATIC IMPORTED) + +# Create imported target glslang::glslang +add_library(glslang::glslang STATIC IMPORTED) + +set_target_properties(glslang::glslang PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "Threads::Threads" +) + +# Create imported target glslang::MachineIndependent +add_library(glslang::MachineIndependent STATIC IMPORTED) + +set_target_properties(glslang::MachineIndependent PROPERTIES + INTERFACE_LINK_LIBRARIES "glslang::glslang" +) + +# Create imported target glslang::GenericCodeGen +add_library(glslang::GenericCodeGen STATIC IMPORTED) + +# Create imported target glslang::glslang-default-resource-limits +add_library(glslang::glslang-default-resource-limits STATIC IMPORTED) + +set_target_properties(glslang::glslang-default-resource-limits PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/glslang-targets-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + if(CMAKE_VERSION VERSION_LESS "3.28" + OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} + OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + endif() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnn-release.cmake b/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnn-release.cmake new file mode 100644 index 0000000..37f24ba --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnn-release.cmake @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Release". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "ncnn" for configuration "Release" +set_property(TARGET ncnn APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(ncnn PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libncnn.a" + ) + +list(APPEND _cmake_import_check_targets ncnn ) +list(APPEND _cmake_import_check_files_for_ncnn "${_IMPORT_PREFIX}/lib/libncnn.a" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnn.cmake b/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnn.cmake new file mode 100644 index 0000000..004bc9d --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnn.cmake @@ -0,0 +1,125 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.12 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.12") + message(FATAL_ERROR "CMake >= 2.8.12 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.12...3.29) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS ncnn) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target ncnn +add_library(ncnn STATIC IMPORTED) + +set_target_properties(ncnn PROPERTIES + INTERFACE_COMPILE_OPTIONS "-fno-rtti;-fno-exceptions" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/ncnn" + INTERFACE_LINK_LIBRARIES "-fopenmp;-static-openmp;Threads::Threads;\$;\$;\$;android;jnigraphics;log" + INTERFACE_POSITION_INDEPENDENT_CODE "ON" +) + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/ncnn-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + if(CMAKE_VERSION VERSION_LESS "3.28" + OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} + OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + endif() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# Make sure the targets which have been exported in some other +# export set exist. +unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets) +foreach(_target "glslang::glslang" "glslang::SPIRV" ) + if(NOT TARGET "${_target}" ) + set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets "${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets} ${_target}") + endif() +endforeach() + +if(DEFINED ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets) + if(CMAKE_FIND_PACKAGE_NAME) + set( ${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE) + set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "The following imported targets are referenced, but are missing: ${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}") + else() + message(FATAL_ERROR "The following imported targets are referenced, but are missing: ${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}") + endif() +endif() +unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnnConfig.cmake b/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnnConfig.cmake new file mode 100644 index 0000000..0e425b6 --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnnConfig.cmake @@ -0,0 +1,54 @@ +set(NCNN_VERSION 20260526) +set(NCNN_OPENMP ON) +set(NCNN_THREADS ON) +set(NCNN_VULKAN ON) +set(NCNN_SHARED_LIB OFF) +set(NCNN_SYSTEM_GLSLANG OFF) +set(NCNN_SIMPLEVK ON) + +if(NCNN_OPENMP) + find_package(OpenMP) +endif() + +if(NCNN_THREADS) + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_package(Threads REQUIRED) +endif() + +if(NCNN_VULKAN) + if(NOT NCNN_SIMPLEVK) + find_package(Vulkan REQUIRED) + endif() + + if(NOT NCNN_SHARED_LIB) + if(NCNN_SYSTEM_GLSLANG) + find_package(SPIRV-Tools QUIET) + find_package(SPIRV-Tools-opt QUIET) + find_package(glslang QUIET) + if(NOT glslang_FOUND) + set(GLSLANG_TARGET_DIR "") + include(${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake) + include(${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake) + if(EXISTS "${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") + # hlsl support can be optional + include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") + endif() + include(${GLSLANG_TARGET_DIR}/glslangTargets.cmake) + include(${GLSLANG_TARGET_DIR}/SPIRVTargets.cmake) + endif() + else() + set(glslang_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../lib/cmake/glslang") + find_package(glslang QUIET) + endif() + endif() +endif() + +include(${CMAKE_CURRENT_LIST_DIR}/ncnn.cmake) + +if(TARGET ncnn) + set(ncnn_FOUND TRUE) + if(NOT ncnn_FIND_QUIETLY) + message(STATUS "Found ncnn: ${NCNN_VERSION}") + endif() +endif() diff --git a/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnnConfigVersion.cmake b/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnnConfigVersion.cmake new file mode 100644 index 0000000..5dda53d --- /dev/null +++ b/app/libs/ncnn/armeabi-v7a/lib/cmake/ncnn/ncnnConfigVersion.cmake @@ -0,0 +1,43 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. +# The variable CVF_VERSION must be set before calling configure_file(). + +set(PACKAGE_VERSION "20260526") + +if (PACKAGE_FIND_VERSION_RANGE) + # Package version must be in the requested version range + if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN) + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + endif() +else() + if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "4" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "4") + math(EXPR installedBits "4 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/app/libs/ncnn/armeabi-v7a/lib/libGenericCodeGen.a b/app/libs/ncnn/armeabi-v7a/lib/libGenericCodeGen.a new file mode 100644 index 0000000..6e37ee8 Binary files /dev/null and b/app/libs/ncnn/armeabi-v7a/lib/libGenericCodeGen.a differ diff --git a/app/libs/ncnn/armeabi-v7a/lib/libMachineIndependent.a b/app/libs/ncnn/armeabi-v7a/lib/libMachineIndependent.a new file mode 100644 index 0000000..6e37ee8 Binary files /dev/null and b/app/libs/ncnn/armeabi-v7a/lib/libMachineIndependent.a differ diff --git a/app/libs/ncnn/armeabi-v7a/lib/libOSDependent.a b/app/libs/ncnn/armeabi-v7a/lib/libOSDependent.a new file mode 100644 index 0000000..6e37ee8 Binary files /dev/null and b/app/libs/ncnn/armeabi-v7a/lib/libOSDependent.a differ diff --git a/app/libs/ncnn/armeabi-v7a/lib/libSPIRV.a b/app/libs/ncnn/armeabi-v7a/lib/libSPIRV.a new file mode 100644 index 0000000..6e37ee8 Binary files /dev/null and b/app/libs/ncnn/armeabi-v7a/lib/libSPIRV.a differ diff --git a/app/libs/ncnn/armeabi-v7a/lib/libglslang-default-resource-limits.a b/app/libs/ncnn/armeabi-v7a/lib/libglslang-default-resource-limits.a new file mode 100644 index 0000000..cc512ce Binary files /dev/null and b/app/libs/ncnn/armeabi-v7a/lib/libglslang-default-resource-limits.a differ diff --git a/app/libs/ncnn/armeabi-v7a/lib/libglslang.a b/app/libs/ncnn/armeabi-v7a/lib/libglslang.a new file mode 100644 index 0000000..5d61915 Binary files /dev/null and b/app/libs/ncnn/armeabi-v7a/lib/libglslang.a differ diff --git a/app/libs/ncnn/armeabi-v7a/lib/libncnn.a b/app/libs/ncnn/armeabi-v7a/lib/libncnn.a new file mode 100644 index 0000000..138973d Binary files /dev/null and b/app/libs/ncnn/armeabi-v7a/lib/libncnn.a differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d5c22b7..bb29895 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,6 +9,7 @@ android:allowBackup="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" + android:largeHeap="true" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.Upscale"> diff --git a/app/src/main/assets/models/animevideov3/meta.json b/app/src/main/assets/models/animevideov3/meta.json new file mode 100644 index 0000000..06af2d1 --- /dev/null +++ b/app/src/main/assets/models/animevideov3/meta.json @@ -0,0 +1,13 @@ +{ + "id": "animevideov3", + "name": "Anime video v3", + "scales": [2, 4], + "format": "NCNN", + "source": "BUNDLED", + "license": "BSD-3-Clause", + "origin": "https://github.com/xinntao/Real-ESRGAN/releases/tag/v0.2.5.0 (realesrgan-ncnn-vulkan-20220424)", + "files": { + "2": ["realesr-animevideov3-x2.param", "realesr-animevideov3-x2.bin"], + "4": ["realesr-animevideov3-x4.param", "realesr-animevideov3-x4.bin"] + } +} diff --git a/app/src/main/assets/models/animevideov3/realesr-animevideov3-x2.bin b/app/src/main/assets/models/animevideov3/realesr-animevideov3-x2.bin new file mode 100644 index 0000000..2069105 Binary files /dev/null and b/app/src/main/assets/models/animevideov3/realesr-animevideov3-x2.bin differ diff --git a/app/src/main/assets/models/animevideov3/realesr-animevideov3-x2.param b/app/src/main/assets/models/animevideov3/realesr-animevideov3-x2.param new file mode 100644 index 0000000..42e7748 --- /dev/null +++ b/app/src/main/assets/models/animevideov3/realesr-animevideov3-x2.param @@ -0,0 +1,43 @@ +7767517 +41 42 +Input input.1 0 1 data +Split splitncnn_input0 1 2 data input.1_splitncnn_0 input.1_splitncnn_1 +Convolution Conv_0 1 1 input.1_splitncnn_1 54 0=64 1=3 4=1 5=1 6=1728 +PReLU PRelu_1 1 1 54 56 0=64 +Convolution Conv_2 1 1 56 57 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_3 1 1 57 59 0=64 +Convolution Conv_4 1 1 59 60 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_5 1 1 60 62 0=64 +Convolution Conv_6 1 1 62 63 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_7 1 1 63 65 0=64 +Convolution Conv_8 1 1 65 66 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_9 1 1 66 68 0=64 +Convolution Conv_10 1 1 68 69 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_11 1 1 69 71 0=64 +Convolution Conv_12 1 1 71 72 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_13 1 1 72 74 0=64 +Convolution Conv_14 1 1 74 75 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_15 1 1 75 77 0=64 +Convolution Conv_16 1 1 77 78 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_17 1 1 78 80 0=64 +Convolution Conv_18 1 1 80 81 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_19 1 1 81 83 0=64 +Convolution Conv_20 1 1 83 84 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_21 1 1 84 86 0=64 +Convolution Conv_22 1 1 86 87 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_23 1 1 87 89 0=64 +Convolution Conv_24 1 1 89 90 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_25 1 1 90 92 0=64 +Convolution Conv_26 1 1 92 93 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_27 1 1 93 95 0=64 +Convolution Conv_28 1 1 95 96 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_29 1 1 96 98 0=64 +Convolution Conv_30 1 1 98 99 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_31 1 1 99 101 0=64 +Convolution Conv_32 1 1 101 102 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_33 1 1 102 104 0=64 +Convolution Conv_34 1 1 104 105 0=48 1=3 4=1 5=1 6=27648 +PixelShuffle DepthToSpace_35 1 1 105 106 0=4 +Interp Resize_37 1 1 input.1_splitncnn_0 111 0=1 1=4.000000e+00 2=4.000000e+00 +BinaryOp Add_38 2 1 106 111 112 +Interp Resize_40 1 1 112 output 0=3 1=5.000000e-01 2=5.000000e-01 diff --git a/app/src/main/assets/models/animevideov3/realesr-animevideov3-x4.bin b/app/src/main/assets/models/animevideov3/realesr-animevideov3-x4.bin new file mode 100644 index 0000000..2069105 Binary files /dev/null and b/app/src/main/assets/models/animevideov3/realesr-animevideov3-x4.bin differ diff --git a/app/src/main/assets/models/animevideov3/realesr-animevideov3-x4.param b/app/src/main/assets/models/animevideov3/realesr-animevideov3-x4.param new file mode 100644 index 0000000..5b922cc --- /dev/null +++ b/app/src/main/assets/models/animevideov3/realesr-animevideov3-x4.param @@ -0,0 +1,42 @@ +7767517 +40 41 +Input input.1 0 1 data +Split splitncnn_input0 1 2 data input.1_splitncnn_0 input.1_splitncnn_1 +Convolution Conv_0 1 1 input.1_splitncnn_1 54 0=64 1=3 4=1 5=1 6=1728 +PReLU PRelu_1 1 1 54 56 0=64 +Convolution Conv_2 1 1 56 57 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_3 1 1 57 59 0=64 +Convolution Conv_4 1 1 59 60 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_5 1 1 60 62 0=64 +Convolution Conv_6 1 1 62 63 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_7 1 1 63 65 0=64 +Convolution Conv_8 1 1 65 66 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_9 1 1 66 68 0=64 +Convolution Conv_10 1 1 68 69 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_11 1 1 69 71 0=64 +Convolution Conv_12 1 1 71 72 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_13 1 1 72 74 0=64 +Convolution Conv_14 1 1 74 75 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_15 1 1 75 77 0=64 +Convolution Conv_16 1 1 77 78 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_17 1 1 78 80 0=64 +Convolution Conv_18 1 1 80 81 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_19 1 1 81 83 0=64 +Convolution Conv_20 1 1 83 84 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_21 1 1 84 86 0=64 +Convolution Conv_22 1 1 86 87 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_23 1 1 87 89 0=64 +Convolution Conv_24 1 1 89 90 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_25 1 1 90 92 0=64 +Convolution Conv_26 1 1 92 93 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_27 1 1 93 95 0=64 +Convolution Conv_28 1 1 95 96 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_29 1 1 96 98 0=64 +Convolution Conv_30 1 1 98 99 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_31 1 1 99 101 0=64 +Convolution Conv_32 1 1 101 102 0=64 1=3 4=1 5=1 6=36864 +PReLU PRelu_33 1 1 102 104 0=64 +Convolution Conv_34 1 1 104 105 0=48 1=3 4=1 5=1 6=27648 +PixelShuffle DepthToSpace_35 1 1 105 106 0=4 +Interp Resize_37 1 1 input.1_splitncnn_0 111 0=1 1=4.000000e+00 2=4.000000e+00 +BinaryOp Add_38 2 1 106 111 output diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt new file mode 100644 index 0000000..23a7d73 --- /dev/null +++ b/app/src/main/cpp/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.22) +project(upscale_jni CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(NCNN_ABI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/ncnn/${ANDROID_ABI}) +set(ncnn_DIR ${NCNN_ABI_DIR}/lib/cmake/ncnn) +find_package(ncnn CONFIG REQUIRED) + +add_library(upscale_jni SHARED upscale_jni.cpp) + +target_include_directories(upscale_jni PRIVATE ${NCNN_ABI_DIR}/include) +target_link_libraries(upscale_jni PRIVATE ncnn) diff --git a/app/src/main/cpp/upscale_jni.cpp b/app/src/main/cpp/upscale_jni.cpp new file mode 100644 index 0000000..a8d3a56 --- /dev/null +++ b/app/src/main/cpp/upscale_jni.cpp @@ -0,0 +1,152 @@ +#include +#include +#include + +#include "net.h" +#include "gpu.h" + +namespace { + +constexpr const char* kInputBlob = "data"; +constexpr const char* kOutputBlob = "output"; + +struct ModelHandle { + ncnn::Net* gpu; + ncnn::Net* cpu; +}; + +bool loadInto(ncnn::Net* net, const char* paramPath, const char* binPath, bool useVulkan) { + net->opt.num_threads = 4; + net->opt.use_vulkan_compute = useVulkan; + return net->load_param(paramPath) == 0 && net->load_model(binPath) == 0; +} + +jbyteArray runTile(JNIEnv* env, const ncnn::Net* net, jbyteArray rgba, jint w, jint h) { + if (env->GetArrayLength(rgba) < w * h * 4) return nullptr; + + jbyte* src = env->GetByteArrayElements(rgba, nullptr); + if (src == nullptr) return nullptr; + ncnn::Mat in = ncnn::Mat::from_pixels( + reinterpret_cast(src), + ncnn::Mat::PIXEL_RGBA2RGB, + w, h); + env->ReleaseByteArrayElements(rgba, src, JNI_ABORT); + + ncnn::Extractor ex = net->create_extractor(); + ex.input(kInputBlob, in); + + ncnn::Mat out; + if (ex.extract(kOutputBlob, out) != 0) return nullptr; + if (out.empty() || out.w <= 0 || out.h <= 0) return nullptr; + + const int ow = out.w; + const int oh = out.h; + std::vector rgb(static_cast(ow) * oh * 3); + out.to_pixels(rgb.data(), ncnn::Mat::PIXEL_RGB); + + jbyteArray result = env->NewByteArray(ow * oh * 4); + if (result == nullptr) return nullptr; + jbyte* dst = env->GetByteArrayElements(result, nullptr); + if (dst == nullptr) return nullptr; + unsigned char* d = reinterpret_cast(dst); + for (int i = 0; i < ow * oh; ++i) { + d[i * 4 + 0] = rgb[i * 3 + 0]; + d[i * 4 + 1] = rgb[i * 3 + 1]; + d[i * 4 + 2] = rgb[i * 3 + 2]; + d[i * 4 + 3] = 255; + } + env->ReleaseByteArrayElements(result, dst, 0); + return result; +} + +} // namespace + +extern "C" JNIEXPORT jint JNICALL +Java_com_sleepy_upscale_local_NcnnBridge_nativeInit(JNIEnv*, jobject) { +#if NCNN_VULKAN + static bool gpuInstanceReady = false; + if (!gpuInstanceReady) { + ncnn::create_gpu_instance(); + gpuInstanceReady = true; + } + return ncnn::get_gpu_count(); +#else + return 0; +#endif +} + +extern "C" JNIEXPORT jlong JNICALL +Java_com_sleepy_upscale_local_NcnnBridge_nativeLoadModel( + JNIEnv* env, jobject, jstring paramPath, jstring binPath) { + const char* param = env->GetStringUTFChars(paramPath, nullptr); + if (param == nullptr) return 0; + const char* bin = env->GetStringUTFChars(binPath, nullptr); + if (bin == nullptr) { + env->ReleaseStringUTFChars(paramPath, param); + return 0; + } + + jlong handle = 0; + auto* model = new (std::nothrow) ModelHandle(); + if (model != nullptr) { + model->gpu = nullptr; + + bool ok = false; + auto* cpuNet = new (std::nothrow) ncnn::Net(); + if (cpuNet != nullptr && loadInto(cpuNet, param, bin, false)) { + model->cpu = cpuNet; + ok = true; + } else { + delete cpuNet; + } + +#if NCNN_VULKAN + if (ok && ncnn::get_gpu_count() > 0) { + auto* gpuNet = new (std::nothrow) ncnn::Net(); + if (gpuNet != nullptr && loadInto(gpuNet, param, bin, true)) { + model->gpu = gpuNet; + } else { + delete gpuNet; + } + } +#endif + + if (ok) { + handle = reinterpret_cast(model); + } else { + delete model; + } + } + + env->ReleaseStringUTFChars(paramPath, param); + env->ReleaseStringUTFChars(binPath, bin); + return handle; +} + +extern "C" JNIEXPORT jbyteArray JNICALL +Java_com_sleepy_upscale_local_NcnnBridge_nativeUpscaleTile( + JNIEnv* env, jobject, jlong handle, jbyteArray rgba, + jint w, jint h, jboolean useGpu) { + auto* model = reinterpret_cast(handle); + if (model == nullptr || model->cpu == nullptr || rgba == nullptr || w <= 0 || h <= 0) return nullptr; + + ncnn::Net* primary = model->cpu; +#if NCNN_VULKAN + if (useGpu == JNI_TRUE && model->gpu != nullptr) primary = model->gpu; +#endif + + jbyteArray result = runTile(env, primary, rgba, w, h); + if (result == nullptr && primary != model->cpu) { + result = runTile(env, model->cpu, rgba, w, h); + } + return result; +} + +extern "C" JNIEXPORT void JNICALL +Java_com_sleepy_upscale_local_NcnnBridge_nativeReleaseModel(JNIEnv*, jobject, jlong handle) { + auto* model = reinterpret_cast(handle); + if (model == nullptr) return; + delete model->gpu; + delete model->cpu; + delete model; +} diff --git a/app/src/main/java/com/sleepy/upscale/MainActivity.kt b/app/src/main/java/com/sleepy/upscale/MainActivity.kt index 59d56b8..91b932c 100644 --- a/app/src/main/java/com/sleepy/upscale/MainActivity.kt +++ b/app/src/main/java/com/sleepy/upscale/MainActivity.kt @@ -11,6 +11,7 @@ import androidx.compose.material3.Surface import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.sleepy.upscale.network.Connectivity import com.sleepy.upscale.ui.MainScreen import com.sleepy.upscale.ui.theme.UpscaleTheme import com.sleepy.upscale.viewmodel.UpscaleViewModel @@ -30,18 +31,36 @@ class MainActivity : ComponentActivity() { UpscaleTheme { val state by viewModel.state.collectAsStateWithLifecycle() val selectedScale by viewModel.selectedScale.collectAsStateWithLifecycle() + val engine by viewModel.engine.collectAsStateWithLifecycle() + val selectedModelId by viewModel.selectedModelId.collectAsStateWithLifecycle() + val imageMeta by viewModel.imageMeta.collectAsStateWithLifecycle() + val oversizeDialogVisible by viewModel.oversizeDialogVisible.collectAsStateWithLifecycle() Surface(modifier = Modifier.fillMaxSize()) { MainScreen( state = state, selectedScale = selectedScale, onScaleChange = { viewModel.setScale(it) }, - onUpscaleClick = { viewModel.startUpscale(this@MainActivity) }, + engine = engine, + onEngineChange = { viewModel.setEngine(it) }, + models = viewModel.models, + selectedModelId = selectedModelId, + onModelChange = { viewModel.setModel(it) }, + oversizeDialogVisible = oversizeDialogVisible, + imageMeta = imageMeta, + fullResVerdict = viewModel.fullResVerdict(selectedScale), + isOnline = Connectivity.isOnline(this@MainActivity), + onUpscaleClick = { viewModel.upscaleClicked(this@MainActivity) }, onSaveClick = { viewModel.downloadFile(this@MainActivity) }, onClearClick = { viewModel.clear() }, + onCancelClick = { viewModel.cancelProcessing() }, onImagePicked = { uri -> viewModel.onImageSelected(this@MainActivity, uri) { _, _ -> } }, + onOversizeDismiss = { viewModel.dismissOversizeDialog() }, + onChooseShrink = { viewModel.chooseShrinkAndUpscale(this@MainActivity) }, + onChooseFullRes = { viewModel.chooseFullRes(this@MainActivity) }, + onChooseCloudOnce = { viewModel.chooseCloudOnce(this@MainActivity) }, ) } } diff --git a/app/src/main/java/com/sleepy/upscale/local/ImagePrep.kt b/app/src/main/java/com/sleepy/upscale/local/ImagePrep.kt new file mode 100644 index 0000000..5859f8f --- /dev/null +++ b/app/src/main/java/com/sleepy/upscale/local/ImagePrep.kt @@ -0,0 +1,151 @@ +package com.sleepy.upscale.local + +import android.content.Context +import android.graphics.Bitmap +import android.graphics.BitmapFactory +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.ColorSpace +import android.graphics.Matrix +import android.graphics.Paint +import android.net.Uri +import androidx.exifinterface.media.ExifInterface +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import java.io.ByteArrayInputStream +import java.io.ByteArrayOutputStream +import java.io.IOException +import kotlin.math.max + +object ImagePrep { + const val JPEG_QUALITY = 95 + + enum class Mode { DOWNSCALE_FIT, FULL_RES } + + data class Prepared( + val bitmap: Bitmap, + val originalWidth: Int, + val originalHeight: Int, + ) + + suspend fun load(context: Context, uri: Uri, scale: Int, mode: Mode): Prepared = + withContext(Dispatchers.IO) { + val bytes = context.contentResolver.openInputStream(uri)?.use { it.readBytes() } + ?: throw IOException("Could not read image") + + val orientation = readOrientation(bytes) + val bounds = BitmapFactory.Options().apply { inJustDecodeBounds = true } + BitmapFactory.decodeByteArray(bytes, 0, bytes.size, bounds) + if (bounds.outWidth <= 0 || bounds.outHeight <= 0) throw IOException("Unsupported image format") + val originalWidth = bounds.outWidth + val originalHeight = bounds.outHeight + + val sampleSize = when (mode) { + Mode.DOWNSCALE_FIT -> coarseSampleSize(originalWidth, originalHeight, scale) + Mode.FULL_RES -> 1 + } + + val decodeOptions = BitmapFactory.Options().apply { + inSampleSize = sampleSize + inPreferredConfig = Bitmap.Config.ARGB_8888 + } + var bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size, decodeOptions) + ?: throw IOException("Could not decode image") + + bitmap = applyOrientation(bitmap, orientation) + bitmap = toSrgbSoftware(bitmap) + if (mode == Mode.DOWNSCALE_FIT) { + bitmap = downscaleToCap(bitmap, scale) + } + Prepared(flattenOpaque(bitmap), originalWidth, originalHeight) + } + + fun readDimensions(context: Context, uri: Uri): Pair? { + val bytes = try { + context.contentResolver.openInputStream(uri)?.use { it.readBytes() } + } catch (_: Exception) { + null + } ?: return null + val bounds = BitmapFactory.Options().apply { inJustDecodeBounds = true } + BitmapFactory.decodeByteArray(bytes, 0, bytes.size, bounds) + return if (bounds.outWidth > 0 && bounds.outHeight > 0) { + bounds.outWidth to bounds.outHeight + } else { + null + } + } + + fun encode(bitmap: Bitmap): ByteArray = + ByteArrayOutputStream().also { output -> + bitmap.compress(Bitmap.CompressFormat.JPEG, JPEG_QUALITY, output) + }.toByteArray() + + private fun readOrientation(bytes: ByteArray): Int = try { + ExifInterface(ByteArrayInputStream(bytes)).getAttributeInt( + ExifInterface.TAG_ORIENTATION, + ExifInterface.ORIENTATION_NORMAL, + ) + } catch (_: Exception) { + ExifInterface.ORIENTATION_NORMAL + } + + private fun applyOrientation(bitmap: Bitmap, orientation: Int): Bitmap { + val matrix = Matrix() + when (orientation) { + ExifInterface.ORIENTATION_ROTATE_90 -> matrix.setRotate(90f) + ExifInterface.ORIENTATION_ROTATE_180 -> matrix.setRotate(180f) + ExifInterface.ORIENTATION_ROTATE_270 -> matrix.setRotate(270f) + ExifInterface.ORIENTATION_FLIP_HORIZONTAL -> matrix.setScale(-1f, 1f) + ExifInterface.ORIENTATION_FLIP_VERTICAL -> matrix.setScale(1f, -1f) + ExifInterface.ORIENTATION_TRANSPOSE -> { + matrix.setRotate(90f) + matrix.postScale(-1f, 1f) + } + ExifInterface.ORIENTATION_TRANSVERSE -> { + matrix.setRotate(-90f) + matrix.postScale(-1f, 1f) + } + else -> return bitmap + } + return Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true) + } + + private fun coarseSampleSize(width: Int, height: Int, scale: Int): Int { + val longEdge = max(width, height) + val targetLongEdge = (Preflight.OUTPUT_CAP_PX / scale).toInt().coerceAtLeast(1) + var sample = 1 + while (longEdge / (sample * 2) >= targetLongEdge) sample *= 2 + return sample + } + + private fun downscaleToCap(bitmap: Bitmap, scale: Int): Bitmap { + val longEdge = max(bitmap.width, bitmap.height) + val targetLongEdge = (Preflight.OUTPUT_CAP_PX / scale).toInt() + if (longEdge <= targetLongEdge) return bitmap + val ratio = targetLongEdge.toFloat() / longEdge + val targetW = max((bitmap.width * ratio).toInt(), 1) + val targetH = max((bitmap.height * ratio).toInt(), 1) + return Bitmap.createScaledBitmap(bitmap, targetW, targetH, true) + } + + private fun toSrgbSoftware(bitmap: Bitmap): Bitmap { + if (bitmap.config == Bitmap.Config.ARGB_8888 && + bitmap.colorSpace == ColorSpace.get(ColorSpace.Named.SRGB) + ) return bitmap + return redraw(bitmap) + } + + private fun flattenOpaque(bitmap: Bitmap): Bitmap { + if (!bitmap.hasAlpha()) return bitmap + return redraw(bitmap) + } + + private fun redraw(source: Bitmap): Bitmap { + val out = Bitmap.createBitmap(source.width, source.height, Bitmap.Config.ARGB_8888) + val canvas = Canvas(out) + canvas.drawColor(Color.WHITE) + canvas.drawBitmap(source, 0f, 0f, Paint(Paint.FILTER_BITMAP_FLAG)) + source.recycle() + return out + } +} diff --git a/app/src/main/java/com/sleepy/upscale/local/LocalUpscaler.kt b/app/src/main/java/com/sleepy/upscale/local/LocalUpscaler.kt new file mode 100644 index 0000000..8233f3b --- /dev/null +++ b/app/src/main/java/com/sleepy/upscale/local/LocalUpscaler.kt @@ -0,0 +1,162 @@ +package com.sleepy.upscale.local + +import android.content.Context +import android.graphics.Bitmap +import android.net.Uri +import android.util.Log +import com.sleepy.upscale.BuildConfig +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.asCoroutineDispatcher +import kotlinx.coroutines.ensureActive +import kotlinx.coroutines.withContext +import java.util.concurrent.Executors +import kotlin.coroutines.coroutineContext + +object LocalUpscaler { + private const val TAG = "LocalUpscaler" + private const val PREPARE_PROGRESS = 0.02f + + data class Outcome( + val bytes: ByteArray, + val outputWidth: Int, + val outputHeight: Int, + val accelerator: String, + val averageMsPerTile: Long, + ) + + private val inferenceDispatcher: CoroutineDispatcher by lazy { + Executors.newSingleThreadExecutor { runnable -> + Thread(runnable, "ncnn-inference") + }.asCoroutineDispatcher() + } + + internal fun inferenceDispatcher(): CoroutineDispatcher = inferenceDispatcher + + suspend fun upscale( + context: Context, + uri: Uri, + scale: Int, + mode: ImagePrep.Mode, + onProgress: (tilesDone: Int, tilesTotal: Int, accelerator: String, progress: Float) -> Unit, + ): Result = withContext(inferenceDispatcher) { + try { + ensureActive() + NcnnBridge.init() + + onProgress(0, 0, "", PREPARE_PROGRESS) + val prepared = ImagePrep.load(context, uri, scale, mode) + ensureActive() + + val modelFiles = ModelRegistry.resolve(context, ModelRegistry.BUNDLED_ID, scale) + ?: return@withContext Result.failure(IllegalStateException("Model does not support ${scale}x")) + val handle = NcnnBridge.nativeLoadModel( + modelFiles.first.absolutePath, + modelFiles.second.absolutePath, + ) + if (handle == 0L) { + return@withContext Result.failure(IllegalStateException("Model failed to load")) + } + + try { + runTiled(handle, prepared, scale, onProgress) + } finally { + NcnnBridge.nativeReleaseModel(handle) + } + } catch (e: CancellationException) { + throw e + } catch (t: Throwable) { + Result.failure(t) + } + } + + private suspend fun runTiled( + handle: Long, + prepared: ImagePrep.Prepared, + scale: Int, + onProgress: (tilesDone: Int, tilesTotal: Int, accelerator: String, progress: Float) -> Unit, + ): Result { + val bitmap = prepared.bitmap + val width = bitmap.width + val height = bitmap.height + val grid = Tiler.computeTiles(width, height) + val tileBytesExpected = grid.tileSize * scale * grid.tileSize * scale * 4 + val outWidth = width * scale + val outHeight = height * scale + + val sourcePixels = IntArray(width * height).also { pixels -> + bitmap.getPixels(pixels, 0, width, 0, 0, width, height) + } + bitmap.recycle() + val destinationPixels = IntArray(outWidth * outHeight) + destinationPixels.fill(0xFF shl 24) + val jobContext = coroutineContext + + var gpuEnabled = NcnnBridge.gpuCount > 0 + var gpuTiles = 0 + var totalMs = 0L + + grid.tiles.forEachIndexed { index, tile -> + jobContext.ensureActive() + + val rgbaTile = Tiler.extractTile(sourcePixels, grid, tile) + val startedAt = System.nanoTime() + var accelerated = gpuEnabled + var upscaled = NcnnBridge.nativeUpscaleTile(handle, rgbaTile, grid.tileSize, grid.tileSize, true) + if (upscaled == null && accelerated) { + accelerated = false + gpuEnabled = false + upscaled = NcnnBridge.nativeUpscaleTile(handle, rgbaTile, grid.tileSize, grid.tileSize, false) + } + totalMs += (System.nanoTime() - startedAt) / 1_000_000L + + if (upscaled == null || upscaled.size != tileBytesExpected) { + throw IllegalStateException("Tile inference failed at ${tile.x},${tile.y}") + } + if (accelerated) gpuTiles++ + + Tiler.blendTile( + destination = destinationPixels, + destinationWidth = outWidth, + destinationHeight = outHeight, + source = upscaled, + sourceWidth = grid.tileSize * scale, + sourceHeight = grid.tileSize * scale, + originX = tile.x * scale, + originY = tile.y * scale, + weightsX = Tiler.edgeWeights(tile.x, grid.tileSize, width, Tiler.OVERLAP), + weightsY = Tiler.edgeWeights(tile.y, grid.tileSize, height, Tiler.OVERLAP), + ) + + val accelerator = if (accelerated) "GPU" else "CPU" + onProgress(index + 1, grid.count, accelerator, progressFraction(index + 1, grid.count)) + } + + val averageMsPerTile = totalMs / grid.tiles.size.coerceAtLeast(1) + logBenchmark(width, height, scale, grid.count, gpuEnabled, averageMsPerTile) + + val outputBitmap = Bitmap.createBitmap(outWidth, outHeight, Bitmap.Config.ARGB_8888) + outputBitmap.setPixels(destinationPixels, 0, outWidth, 0, 0, outWidth, outHeight) + destinationPixels.fill(0) + val bytes = ImagePrep.encode(outputBitmap) + outputBitmap.recycle() + + return Result.success( + Outcome( + bytes = bytes, + outputWidth = outWidth, + outputHeight = outHeight, + accelerator = if (gpuTiles > 0) "GPU" else "CPU", + averageMsPerTile = averageMsPerTile, + ), + ) + } + + private fun progressFraction(done: Int, total: Int): Float = + if (total <= 0) PREPARE_PROGRESS else PREPARE_PROGRESS + (done.toFloat() / total) * (1f - PREPARE_PROGRESS) + + private fun logBenchmark(inWidth: Int, inHeight: Int, scale: Int, tiles: Int, gpu: Boolean, msPerTile: Long) { + if (!BuildConfig.DEBUG) return + Log.d(TAG, "${inWidth}x${inHeight} x$scale · $tiles tiles · ${if (gpu) "GPU" else "CPU"} · ~${msPerTile}ms/tile") + } +} diff --git a/app/src/main/java/com/sleepy/upscale/local/ModelRegistry.kt b/app/src/main/java/com/sleepy/upscale/local/ModelRegistry.kt new file mode 100644 index 0000000..5d99e95 --- /dev/null +++ b/app/src/main/java/com/sleepy/upscale/local/ModelRegistry.kt @@ -0,0 +1,51 @@ +package com.sleepy.upscale.local + +import android.content.Context +import java.io.File +import java.io.IOException + +data class ModelDescriptor( + val id: String, + val name: String, + val allowedScales: List, +) + +object ModelRegistry { + const val BUNDLED_ID = "animevideov3" + private const val BUNDLED_ASSET_DIR = "models/$BUNDLED_ID" + + fun list(): List = listOf( + ModelDescriptor( + id = BUNDLED_ID, + name = "Anime video v3", + allowedScales = listOf(2, 4), + ), + ) + + fun resolve(context: Context, modelId: String, scale: Int): Pair? { + if (modelId != BUNDLED_ID) return null + val descriptor = list().first { it.id == modelId } + if (scale !in descriptor.allowedScales) return null + + val targetDir = File(context.filesDir, "models/$modelId").apply { mkdirs() } + val paramFile = File(targetDir, "x$scale.param") + val binFile = File(targetDir, "x$scale.bin") + + try { + if (!paramFile.isFile || !binFile.isFile) { + copyAsset(context, "$BUNDLED_ASSET_DIR/realesr-animevideov3-x$scale.param", paramFile) + copyAsset(context, "$BUNDLED_ASSET_DIR/realesr-animevideov3-x$scale.bin", binFile) + } + } catch (_: IOException) { + return null + } + if (!paramFile.isFile || paramFile.length() == 0L || !binFile.isFile || binFile.length() == 0L) return null + return paramFile to binFile + } + + private fun copyAsset(context: Context, assetPath: String, target: File) { + context.assets.open(assetPath).use { input -> + target.outputStream().use { output -> input.copyTo(output) } + } + } +} diff --git a/app/src/main/java/com/sleepy/upscale/local/NcnnBridge.kt b/app/src/main/java/com/sleepy/upscale/local/NcnnBridge.kt new file mode 100644 index 0000000..465dd15 --- /dev/null +++ b/app/src/main/java/com/sleepy/upscale/local/NcnnBridge.kt @@ -0,0 +1,35 @@ +package com.sleepy.upscale.local + +object NcnnBridge { + init { + System.loadLibrary("upscale_jni") + } + + var gpuCount: Int = 0 + private set + + private var initialized = false + + @Synchronized + fun init(): Int { + if (!initialized) { + gpuCount = nativeInit() + initialized = true + } + return gpuCount + } + + external fun nativeLoadModel(paramPath: String, binPath: String): Long + + external fun nativeUpscaleTile( + handle: Long, + rgba: ByteArray, + width: Int, + height: Int, + useGpu: Boolean, + ): ByteArray? + + external fun nativeReleaseModel(handle: Long) + + private external fun nativeInit(): Int +} diff --git a/app/src/main/java/com/sleepy/upscale/local/Preflight.kt b/app/src/main/java/com/sleepy/upscale/local/Preflight.kt new file mode 100644 index 0000000..a93e581 --- /dev/null +++ b/app/src/main/java/com/sleepy/upscale/local/Preflight.kt @@ -0,0 +1,60 @@ +package com.sleepy.upscale.local + +import kotlin.math.ceil +import kotlin.math.max +import kotlin.math.min +import kotlin.math.roundToInt + +object Preflight { + const val HEADROOM = 2.0f + const val OUTPUT_CAP_PX = 4096L + const val OVERSIZE_TRIGGER_PX = 1024L + + data class Estimate(val inputBytes: Long, val outputBytes: Long, val totalBytes: Long) + + sealed interface FullResVerdict { + val estimate: Estimate + + data class Allowed(override val estimate: Estimate) : FullResVerdict + data class Denied(override val estimate: Estimate, val reason: String) : FullResVerdict + } + + fun isOversize(width: Int, height: Int): Boolean = + max(width, height) > OVERSIZE_TRIGGER_PX + + fun estimateRamBytes(inWidth: Int, inHeight: Int, scale: Int): Estimate { + val inputPixels = inWidth.toLong() * inHeight.toLong() + val outputPixels = inputPixels * scale.toLong() * scale.toLong() + val total = ceil((inputPixels + outputPixels) * 4.0 * HEADROOM).toLong() + return Estimate( + inputBytes = inputPixels * 4L, + outputBytes = outputPixels * 4L, + totalBytes = total, + ) + } + + fun evaluateFullRes(inWidth: Int, inHeight: Int, scale: Int, maxHeapBytes: Long): FullResVerdict { + val estimate = estimateRamBytes(inWidth, inHeight, scale) + return if (estimate.totalBytes <= maxHeapBytes) { + FullResVerdict.Allowed(estimate) + } else { + FullResVerdict.Denied( + estimate = estimate, + reason = "Needs about ${formatMb(estimate.totalBytes)} of memory; this device allows ${formatMb(maxHeapBytes)}", + ) + } + } + + fun fitDimensions(inWidth: Int, inHeight: Int, scale: Int, capPx: Long = OUTPUT_CAP_PX): Pair { + require(inWidth > 0 && inHeight > 0 && scale > 0) + val longEdge = max(inWidth, inHeight) + val targetLongEdge = min(longEdge.toLong(), capPx / scale).toInt() + if (targetLongEdge == longEdge) return inWidth to inHeight + val ratio = targetLongEdge.toFloat() / longEdge + val outW = max((inWidth * ratio).roundToInt(), 1) + val outH = max((inHeight * ratio).roundToInt(), 1) + return outW to outH + } + + fun formatMb(bytes: Long): String = "${(bytes + (1L shl 20) - 1) shr 20} MB" +} diff --git a/app/src/main/java/com/sleepy/upscale/local/SmokeCheck.kt b/app/src/main/java/com/sleepy/upscale/local/SmokeCheck.kt new file mode 100644 index 0000000..193aa77 --- /dev/null +++ b/app/src/main/java/com/sleepy/upscale/local/SmokeCheck.kt @@ -0,0 +1,114 @@ +package com.sleepy.upscale.local + +import android.content.Context +import android.graphics.Bitmap +import android.net.Uri +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.withContext + +object SmokeCheck { + data class Report( + val gpuCount: Int, + val gpuMs: Long?, + val cpuMs: Long?, + val before: Bitmap, + val after: Bitmap, + val scale: Int, + ) + + suspend fun run(context: Context, uri: Uri): Result = + withContext(LocalUpscaler.inferenceDispatcher()) { + try { + NcnnBridge.init() + val modelFiles = ModelRegistry.resolve(context, ModelRegistry.BUNDLED_ID, 4) + ?: return@withContext Result.failure(IllegalStateException("Bundled model unavailable")) + val handle = NcnnBridge.nativeLoadModel( + modelFiles.first.absolutePath, + modelFiles.second.absolutePath, + ) + if (handle == 0L) { + return@withContext Result.failure(IllegalStateException("Model failed to load")) + } + + try { + val prepared = ImagePrep.load(context, uri, 4, ImagePrep.Mode.FULL_RES) + val bitmap = prepared.bitmap + val width = bitmap.width + val height = bitmap.height + val grid = Tiler.computeTiles(width, height) + val sourcePixels = IntArray(width * height).also { pixels -> + bitmap.getPixels(pixels, 0, width, 0, 0, width, height) + } + bitmap.recycle() + + val centerTile = Tile( + x = ((width - grid.tileSize) / 2).coerceAtLeast(0), + y = ((height - grid.tileSize) / 2).coerceAtLeast(0), + ) + val rgbaTile = Tiler.extractTile(sourcePixels, grid, centerTile) + + var gpuResult: ByteArray? + var cpuResult: ByteArray? + + val gpuStartedAt = System.nanoTime() + gpuResult = NcnnBridge.nativeUpscaleTile(handle, rgbaTile, grid.tileSize, grid.tileSize, true) + val gpuMs = if (gpuResult != null) (System.nanoTime() - gpuStartedAt) / 1_000_000L else null + + val cpuStartedAt = System.nanoTime() + cpuResult = NcnnBridge.nativeUpscaleTile(handle, rgbaTile, grid.tileSize, grid.tileSize, false) + val cpuMs = if (cpuResult != null) (System.nanoTime() - cpuStartedAt) / 1_000_000L else null + + val best = gpuResult ?: cpuResult + ?: return@withContext Result.failure(IllegalStateException("Tile inference failed")) + + val size = grid.tileSize * 4 + val afterBitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888).apply { + setPixels(rgbaToArgb(best, size, size), 0, size, 0, 0, size, size) + } + val beforeBitmap = Bitmap.createBitmap(grid.tileSize, grid.tileSize, Bitmap.Config.ARGB_8888).apply { + setPixels(tileRegionArgb(sourcePixels, grid, centerTile), 0, grid.tileSize, 0, 0, grid.tileSize, grid.tileSize) + } + Result.success( + Report( + gpuCount = NcnnBridge.gpuCount, + gpuMs = gpuMs, + cpuMs = cpuMs, + before = beforeBitmap, + after = afterBitmap, + scale = 4, + ), + ) + } finally { + NcnnBridge.nativeReleaseModel(handle) + } + } catch (e: kotlinx.coroutines.CancellationException) { + throw e + } catch (t: Throwable) { + Result.failure(t) + } + } + + private fun rgbaToArgb(bytes: ByteArray, width: Int, height: Int): IntArray { + val out = IntArray(width * height) + for (i in out.indices) { + val r = bytes[i * 4].toInt() and 0xFF + val g = bytes[i * 4 + 1].toInt() and 0xFF + val b = bytes[i * 4 + 2].toInt() and 0xFF + out[i] = (0xFF shl 24) or (r shl 16) or (g shl 8) or b + } + return out + } + + private fun tileRegionArgb(source: IntArray, grid: TileGrid, tile: Tile): IntArray { + val size = grid.tileSize + val out = IntArray(size * size) + for (row in 0 until size) { + val sy = (tile.y + row).coerceAtMost(grid.imageHeight - 1) + for (column in 0 until size) { + val sx = (tile.x + column).coerceAtMost(grid.imageWidth - 1) + out[row * size + column] = source[sy * grid.imageWidth + sx] + } + } + return out + } +} diff --git a/app/src/main/java/com/sleepy/upscale/local/Tiler.kt b/app/src/main/java/com/sleepy/upscale/local/Tiler.kt new file mode 100644 index 0000000..cbda029 --- /dev/null +++ b/app/src/main/java/com/sleepy/upscale/local/Tiler.kt @@ -0,0 +1,115 @@ +package com.sleepy.upscale.local + +import kotlin.math.min + +data class Tile(val x: Int, val y: Int) + +data class TileGrid( + val tiles: List, + val tileSize: Int, + val imageWidth: Int, + val imageHeight: Int, +) { + val count: Int get() = tiles.size +} + +object Tiler { + const val TILE_SIZE = 256 + const val OVERLAP = 16 + + fun positions(length: Int, tile: Int, overlap: Int): List { + require(tile > overlap) { "tile size must exceed overlap" } + if (length <= tile) return listOf(0) + val stride = tile - overlap + val result = mutableListOf() + var position = 0 + while (position + tile < length) { + result += position + position += stride + } + result += length - tile + return result + } + + fun computeTiles(width: Int, height: Int, tile: Int = TILE_SIZE, overlap: Int = OVERLAP): TileGrid { + require(width > 0 && height > 0) { "image dimensions must be positive" } + val columns = positions(width, tile, overlap) + val rows = positions(height, tile, overlap) + val tiles = rows.flatMap { y -> columns.map { x -> Tile(x, y) } } + return TileGrid(tiles, tile, width, height) + } + + fun edgeWeights(origin: Int, size: Int, extent: Int, overlap: Int): FloatArray { + require(size > 0) { "size must be positive" } + val firstFades = origin > 0 + val lastFades = origin + size < extent + return FloatArray(size) { i -> + val left = if (!firstFades || i >= overlap) 1f else i.toFloat() / overlap + val distanceFromRight = size - 1 - i + val right = if (!lastFades || distanceFromRight >= overlap) 1f else distanceFromRight.toFloat() / overlap + min(left, right) + } + } + + fun extractTile(source: IntArray, grid: TileGrid, tile: Tile): ByteArray { + val size = grid.tileSize + val out = ByteArray(size * size * 4) + for (row in 0 until size) { + val sy = (tile.y + row).coerceAtMost(grid.imageHeight - 1) + val sourceRow = sy * grid.imageWidth + var offset = row * size * 4 + for (column in 0 until size) { + val sx = (tile.x + column).coerceAtMost(grid.imageWidth - 1) + val pixel = source[sourceRow + sx] + out[offset] = (pixel shr 16 and 0xFF).toByte() + out[offset + 1] = (pixel shr 8 and 0xFF).toByte() + out[offset + 2] = (pixel and 0xFF).toByte() + out[offset + 3] = 0xFF.toByte() + offset += 4 + } + } + return out + } + + fun blendTile( + destination: IntArray, + destinationWidth: Int, + destinationHeight: Int, + source: ByteArray, + sourceWidth: Int, + sourceHeight: Int, + originX: Int, + originY: Int, + weightsX: FloatArray, + weightsY: FloatArray, + ) { + for (row in 0 until sourceHeight) { + val dy = originY + row + if (dy >= destinationHeight) break + val weightY = weightsY[row] + var si = row * sourceWidth * 4 + for (column in 0 until sourceWidth) { + val dx = originX + column + if (dx >= destinationWidth) break + val alpha = weightY * weightsX[column] + val r = source[si].toInt() and 0xFF + val g = source[si + 1].toInt() and 0xFF + val b = source[si + 2].toInt() and 0xFF + val di = dy * destinationWidth + dx + destination[di] = if (alpha >= 1f) { + (0xFF shl 24) or (r shl 16) or (g shl 8) or b + } else { + val previous = destination[di] + val pr = previous shr 16 and 0xFF + val pg = previous shr 8 and 0xFF + val pb = previous and 0xFF + val nr = (r * alpha + pr * (1f - alpha)).toInt() + val ng = (g * alpha + pg * (1f - alpha)).toInt() + val nb = (b * alpha + pb * (1f - alpha)).toInt() + (0xFF shl 24) or (nr shl 16) or (ng shl 8) or nb + } + si += 4 + } + } + } +} diff --git a/app/src/main/java/com/sleepy/upscale/network/Connectivity.kt b/app/src/main/java/com/sleepy/upscale/network/Connectivity.kt new file mode 100644 index 0000000..8abf749 --- /dev/null +++ b/app/src/main/java/com/sleepy/upscale/network/Connectivity.kt @@ -0,0 +1,14 @@ +package com.sleepy.upscale.network + +import android.content.Context +import android.net.ConnectivityManager +import android.net.NetworkCapabilities + +object Connectivity { + fun isOnline(context: Context): Boolean { + val manager = context.getSystemService(ConnectivityManager::class.java) ?: return false + val network = manager.activeNetwork ?: return false + val capabilities = manager.getNetworkCapabilities(network) ?: return false + return capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED) + } +} diff --git a/app/src/main/java/com/sleepy/upscale/ui/MainScreen.kt b/app/src/main/java/com/sleepy/upscale/ui/MainScreen.kt index 246aa40..cd24a58 100644 --- a/app/src/main/java/com/sleepy/upscale/ui/MainScreen.kt +++ b/app/src/main/java/com/sleepy/upscale/ui/MainScreen.kt @@ -11,11 +11,22 @@ import androidx.compose.animation.fadeOut import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideOutVertically import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import com.sleepy.upscale.BuildConfig import com.sleepy.upscale.UpscaleState +import com.sleepy.upscale.local.ModelDescriptor +import com.sleepy.upscale.local.Preflight +import com.sleepy.upscale.viewmodel.Engine +import com.sleepy.upscale.viewmodel.UpscaleViewModel.ImageMeta import com.sleepy.upscale.ui.components.GlassBackdrop import com.sleepy.upscale.ui.screens.DownloadScreen import com.sleepy.upscale.ui.screens.ErrorScreen +import com.sleepy.upscale.ui.screens.OversizeDialog import com.sleepy.upscale.ui.screens.ProcessingScreen +import com.sleepy.upscale.ui.screens.SmokeScreen import com.sleepy.upscale.ui.screens.UploadScreen @Composable @@ -23,11 +34,26 @@ fun MainScreen( state: UpscaleState, selectedScale: Int, onScaleChange: (Int) -> Unit, + engine: Engine, + onEngineChange: (Engine) -> Unit, + models: List, + selectedModelId: String?, + onModelChange: (String) -> Unit, + oversizeDialogVisible: Boolean, + imageMeta: ImageMeta?, + fullResVerdict: Preflight.FullResVerdict?, + isOnline: Boolean, onUpscaleClick: () -> Unit, onSaveClick: () -> Unit, onClearClick: () -> Unit, + onCancelClick: () -> Unit, onImagePicked: (Uri) -> Unit, + onOversizeDismiss: () -> Unit, + onChooseShrink: () -> Unit, + onChooseFullRes: () -> Unit, + onChooseCloudOnce: () -> Unit, ) { + var showSmokeCheck by remember { mutableStateOf(false) } val picker = rememberLauncherForActivityResult(ActivityResultContracts.GetContent()) { uri -> uri?.let { onImagePicked(it) } } @@ -41,32 +67,33 @@ fun MainScreen( GlassBackdrop { AnimatedContent( - targetState = screenKey, + targetState = if (showSmokeCheck && BuildConfig.DEBUG) "smoke" else screenKey, transitionSpec = { - when (targetState) { - "upload" -> ContentTransform( - fadeIn(tween(350)) + slideInVertically(tween(350)) { it / 4 }, - fadeOut(tween(200)) + slideOutVertically(tween(200)) { -it / 4 }, - ) - else -> ContentTransform( - fadeIn(tween(400)) + slideInVertically(tween(400)) { it / 3 }, - fadeOut(tween(200)) + slideOutVertically(tween(200)) { -it / 3 }, - ) - } + ContentTransform( + fadeIn(tween(400)) + slideInVertically(tween(400)) { it / 3 }, + fadeOut(tween(200)) + slideOutVertically(tween(200)) { -it / 3 }, + ) }, label = "screen_transition", ) { key -> when (key) { + "smoke" -> SmokeScreen(onBack = { showSmokeCheck = false }) "upload" -> UploadScreen( state = state, selectedScale = selectedScale, onScaleChange = onScaleChange, + engine = engine, + onEngineChange = onEngineChange, + models = models, + selectedModelId = selectedModelId, + onModelChange = onModelChange, onUpscaleClick = onUpscaleClick, onPickImage = { picker.launch("image/*") }, + onSmokeCheckClick = { showSmokeCheck = true }, ) "processing" -> { val s = state as? UpscaleState.Processing ?: return@AnimatedContent - ProcessingScreen(state = s) + ProcessingScreen(state = s, onCancelClick = onCancelClick) } "download" -> DownloadScreen( state = state, @@ -79,5 +106,20 @@ fun MainScreen( } } } + + if (oversizeDialogVisible) { + imageMeta?.let { meta -> + OversizeDialog( + meta = meta, + scale = selectedScale, + verdict = fullResVerdict, + isOnline = isOnline, + onDismiss = onOversizeDismiss, + onShrinkUpscale = onChooseShrink, + onFullRes = onChooseFullRes, + onCloudOnce = onChooseCloudOnce, + ) + } + } } } diff --git a/app/src/main/java/com/sleepy/upscale/ui/screens/OversizeDialog.kt b/app/src/main/java/com/sleepy/upscale/ui/screens/OversizeDialog.kt new file mode 100644 index 0000000..82b91e5 --- /dev/null +++ b/app/src/main/java/com/sleepy/upscale/ui/screens/OversizeDialog.kt @@ -0,0 +1,160 @@ +package com.sleepy.upscale.ui.screens + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.systemBarsPadding +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.Dialog +import androidx.compose.ui.window.DialogProperties +import com.sleepy.upscale.local.Preflight +import com.sleepy.upscale.viewmodel.UpscaleViewModel.ImageMeta +import com.sleepy.upscale.ui.components.GlassButton +import com.sleepy.upscale.ui.components.GlassButtonVariant +import com.sleepy.upscale.ui.components.GlassPanel +import com.sleepy.upscale.ui.components.GlassTag +import com.sleepy.upscale.ui.theme.DangerRed +import com.sleepy.upscale.ui.theme.TextSecondary +import com.sleepy.upscale.local.Preflight.FullResVerdict + +@Composable +fun OversizeDialog( + meta: ImageMeta, + scale: Int, + verdict: FullResVerdict?, + isOnline: Boolean, + onDismiss: () -> Unit, + onShrinkUpscale: () -> Unit, + onFullRes: () -> Unit, + onCloudOnce: () -> Unit, +) { + Dialog( + onDismissRequest = onDismiss, + properties = DialogProperties(usePlatformDefaultWidth = false), + ) { + GlassPanel( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 20.dp) + .systemBarsPadding(), + ) { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 24.dp, vertical = 28.dp), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Text( + text = "LARGE IMAGE", + style = MaterialTheme.typography.labelSmall, + color = TextSecondary, + ) + + Spacer(Modifier.height(10.dp)) + + Text( + text = "This photo is big for on-device upscaling", + style = MaterialTheme.typography.headlineSmall, + color = MaterialTheme.colorScheme.onSurface, + textAlign = TextAlign.Center, + ) + + Spacer(Modifier.height(6.dp)) + + Text( + text = "${meta.width} × ${meta.height} px · scaling ${scale}x", + style = MaterialTheme.typography.bodyMedium, + color = TextSecondary, + ) + + Spacer(Modifier.height(22.dp)) + + OptionRow( + title = "Shrink and upscale", + detail = "Recommended · output up to ${Preflight.OUTPUT_CAP_PX} px long edge", + recommended = true, + enabled = true, + primary = true, + onClick = onShrinkUpscale, + ) + + Spacer(Modifier.height(10.dp)) + + OptionRow( + title = "Try cloud once", + detail = if (isOnline) "Upload this photo to iloveimg instead" else "Needs an internet connection", + recommended = false, + enabled = isOnline, + primary = false, + onClick = onCloudOnce, + ) + + Spacer(Modifier.height(10.dp)) + + OptionRow( + title = "Full resolution anyway", + detail = when (verdict) { + null -> "Estimating memory..." + is FullResVerdict.Allowed -> "About ${Preflight.formatMb(verdict.estimate.totalBytes)} of memory needed" + is FullResVerdict.Denied -> verdict.reason + }, + recommended = false, + enabled = verdict is FullResVerdict.Allowed, + primary = false, + onClick = onFullRes, + ) + + Spacer(Modifier.height(8.dp)) + + TextButton(onClick = onDismiss) { + Text(text = "Cancel") + } + } + } + } +} + +@Composable +private fun OptionRow( + title: String, + detail: String, + recommended: Boolean, + enabled: Boolean, + primary: Boolean, + onClick: () -> Unit, +) { + Column(horizontalAlignment = Alignment.CenterHorizontally) { + GlassButton( + text = title, + onClick = onClick, + enabled = enabled, + variant = if (primary) GlassButtonVariant.Primary else GlassButtonVariant.Ghost, + modifier = Modifier.fillMaxWidth(), + ) + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Center, + ) { + if (recommended) { + GlassTag(text = "RECOMMENDED", modifier = Modifier.padding(end = 6.dp)) + } + Text( + text = detail, + style = MaterialTheme.typography.labelMedium, + color = if (enabled) TextSecondary else DangerRed.copy(alpha = 0.9f), + textAlign = TextAlign.Center, + ) + } + } +} diff --git a/app/src/main/java/com/sleepy/upscale/ui/screens/ProcessingScreen.kt b/app/src/main/java/com/sleepy/upscale/ui/screens/ProcessingScreen.kt index 2919b12..3710215 100644 --- a/app/src/main/java/com/sleepy/upscale/ui/screens/ProcessingScreen.kt +++ b/app/src/main/java/com/sleepy/upscale/ui/screens/ProcessingScreen.kt @@ -35,6 +35,8 @@ import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import com.sleepy.upscale.UpscaleState +import com.sleepy.upscale.ui.components.GlassButton +import com.sleepy.upscale.ui.components.GlassButtonVariant import com.sleepy.upscale.ui.components.GlassPanel import com.sleepy.upscale.ui.theme.TextPrimary import com.sleepy.upscale.ui.theme.TextSecondary @@ -43,7 +45,10 @@ import com.sleepy.upscale.ui.theme.Primary import com.sleepy.upscale.ui.theme.BlobViolet @Composable -fun ProcessingScreen(state: UpscaleState.Processing) { +fun ProcessingScreen( + state: UpscaleState.Processing, + onCancelClick: (() -> Unit)? = null, +) { val infiniteTransition = rememberInfiniteTransition(label = "processing") val rotation by infiniteTransition.animateFloat( @@ -161,5 +166,15 @@ fun ProcessingScreen(state: UpscaleState.Processing) { } Spacer(Modifier.weight(0.65f)) + + if (onCancelClick != null) { + GlassButton( + text = "Cancel", + variant = GlassButtonVariant.Ghost, + onClick = onCancelClick, + modifier = Modifier.fillMaxWidth(), + ) + Spacer(Modifier.height(24.dp)) + } } } diff --git a/app/src/main/java/com/sleepy/upscale/ui/screens/SmokeScreen.kt b/app/src/main/java/com/sleepy/upscale/ui/screens/SmokeScreen.kt new file mode 100644 index 0000000..1bc570e --- /dev/null +++ b/app/src/main/java/com/sleepy/upscale/ui/screens/SmokeScreen.kt @@ -0,0 +1,167 @@ +package com.sleepy.upscale.ui.screens + +import androidx.activity.compose.rememberLauncherForActivityResult +import androidx.activity.result.contract.ActivityResultContracts +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.aspectRatio +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.systemBarsPadding +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.asImageBitmap +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import com.sleepy.upscale.local.SmokeCheck +import com.sleepy.upscale.ui.components.GlassButton +import com.sleepy.upscale.ui.components.GlassButtonVariant +import com.sleepy.upscale.ui.components.GlassPanel +import com.sleepy.upscale.ui.components.GlassTag +import com.sleepy.upscale.ui.theme.DangerRed +import com.sleepy.upscale.ui.theme.SuccessGreen +import com.sleepy.upscale.ui.theme.TextPrimary +import com.sleepy.upscale.ui.theme.TextSecondary +import kotlinx.coroutines.launch + +@Composable +fun SmokeScreen(onBack: () -> Unit) { + val context = LocalContext.current + val scope = rememberCoroutineScope() + var report by remember { mutableStateOf(null) } + var error by remember { mutableStateOf(null) } + var running by remember { mutableStateOf(false) } + + val picker = rememberLauncherForActivityResult(ActivityResultContracts.GetContent()) { uri -> + if (uri != null) { + running = true + error = null + report = null + scope.launch { + SmokeCheck.run(context.applicationContext, uri) + .onSuccess { report = it } + .onFailure { error = it.message ?: "smoke check failed" } + running = false + } + } + } + + Column( + modifier = Modifier + .fillMaxSize() + .padding(horizontal = 24.dp) + .systemBarsPadding(), + ) { + Spacer(Modifier.height(40.dp)) + + Text( + text = "ENGINE SELF-CHECK", + style = MaterialTheme.typography.labelSmall, + color = TextSecondary, + ) + + Spacer(Modifier.height(10.dp)) + + Text( + text = "One-tile NCNN smoke test", + style = MaterialTheme.typography.displayLarge, + color = TextPrimary, + ) + + Spacer(Modifier.height(20.dp)) + + GlassButton( + text = when { + running -> "Running..." + report != null -> "Run another tile" + else -> "Pick an image and run" + }, + loading = running, + onClick = { picker.launch("image/*") }, + modifier = Modifier.fillMaxWidth(), + ) + + Spacer(Modifier.height(16.dp)) + + val r = report + if (r != null) { + GlassPanel(modifier = Modifier.fillMaxWidth()) { + Column(Modifier.padding(20.dp)) { + Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) { + Image( + bitmap = r.before.asImageBitmap(), + contentDescription = "Original tile", + modifier = Modifier.weight(1f).aspectRatio(1f), + contentScale = ContentScale.Fit, + ) + Image( + bitmap = r.after.asImageBitmap(), + contentDescription = "Upscaled tile", + modifier = Modifier.weight(1f).aspectRatio(1f), + contentScale = ContentScale.Fit, + ) + } + + Spacer(Modifier.height(14.dp)) + + Text( + text = "${r.gpuCount} GPU device(s) · x${r.scale}", + style = MaterialTheme.typography.bodyMedium, + color = TextPrimary, + ) + Spacer(Modifier.height(4.dp)) + TimingLine(label = "GPU", ms = r.gpuMs) + TimingLine(label = "CPU", ms = r.cpuMs) + } + } + } + + error?.let { message -> + Spacer(Modifier.height(16.dp)) + Text( + text = message, + style = MaterialTheme.typography.bodyMedium, + color = DangerRed, + textAlign = TextAlign.Center, + modifier = Modifier.fillMaxWidth(), + ) + } + + Spacer(Modifier.weight(1f)) + + GlassButton( + text = "Back", + variant = GlassButtonVariant.Ghost, + onClick = onBack, + modifier = Modifier.fillMaxWidth(), + ) + + Spacer(Modifier.height(24.dp)) + } +} + +@Composable +private fun TimingLine(label: String, ms: Long?) { + Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { + GlassTag(text = label) + Text( + text = ms?.let { "$it ms/tile" } ?: "unavailable", + style = MaterialTheme.typography.bodySmall, + color = if (ms != null) SuccessGreen else TextSecondary, + ) + } +} diff --git a/app/src/main/java/com/sleepy/upscale/ui/screens/UploadScreen.kt b/app/src/main/java/com/sleepy/upscale/ui/screens/UploadScreen.kt index 1387ce4..5b5f24f 100644 --- a/app/src/main/java/com/sleepy/upscale/ui/screens/UploadScreen.kt +++ b/app/src/main/java/com/sleepy/upscale/ui/screens/UploadScreen.kt @@ -24,6 +24,7 @@ import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size @@ -35,11 +36,14 @@ import androidx.compose.foundation.selection.selectableGroup import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.DropdownMenu +import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableFloatStateOf +import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment @@ -60,7 +64,10 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import coil.compose.AsyncImage import coil.request.ImageRequest +import com.sleepy.upscale.BuildConfig import com.sleepy.upscale.UpscaleState +import com.sleepy.upscale.local.ModelDescriptor +import com.sleepy.upscale.viewmodel.Engine import com.sleepy.upscale.ui.components.GlassButton import com.sleepy.upscale.ui.components.GlassPanel import com.sleepy.upscale.ui.components.GlassTag @@ -80,8 +87,14 @@ fun UploadScreen( state: UpscaleState, selectedScale: Int, onScaleChange: (Int) -> Unit, + engine: Engine, + onEngineChange: (Engine) -> Unit, + models: List, + selectedModelId: String?, + onModelChange: (String) -> Unit, onUpscaleClick: () -> Unit, onPickImage: () -> Unit, + onSmokeCheckClick: () -> Unit = {}, ) { val haptic = LocalHapticFeedback.current val selected = state as? UpscaleState.ImageSelected @@ -154,7 +167,36 @@ fun UploadScreen( Spacer(Modifier.height(24.dp)) - ScaleSelector(selectedScale = selectedScale, onScaleChange = onScaleChange) + SegmentedSelector( + label = "SCALE MULTIPLIER", + options = listOf("2×", "4×"), + selectedIndex = if (selectedScale == 2) 0 else 1, + onSelect = { index -> onScaleChange(if (index == 0) 2 else 4) }, + ) + + Spacer(Modifier.height(16.dp)) + + SegmentedSelector( + label = "ENGINE", + options = listOf(Engine.CLOUD.label, Engine.LOCAL.label), + selectedIndex = if (engine == Engine.CLOUD) 0 else 1, + onSelect = { index -> onEngineChange(if (index == 0) Engine.CLOUD else Engine.LOCAL) }, + ) + + AnimatedVisibility( + visible = engine == Engine.LOCAL && models.isNotEmpty(), + enter = fadeIn() + slideInVertically { it / 3 }, + exit = fadeOut(), + ) { + Column { + Spacer(Modifier.height(16.dp)) + ModelSelector( + models = models, + selectedModelId = selectedModelId, + onModelChange = onModelChange, + ) + } + } Spacer(Modifier.height(16.dp)) @@ -168,6 +210,23 @@ fun UploadScreen( modifier = Modifier.fillMaxWidth(), ) + if (BuildConfig.DEBUG) { + Spacer(Modifier.height(12.dp)) + Box( + modifier = Modifier + .clip(RoundedCornerShape(999.dp)) + .clickable( + role = Role.Button, + onClickLabel = "Open engine self-check", + onClick = onSmokeCheckClick, + ) + .padding(horizontal = 12.dp, vertical = 8.dp), + contentAlignment = Alignment.Center, + ) { + GlassTag(text = "ENGINE SELF-CHECK") + } + } + Spacer(Modifier.height(24.dp)) } } @@ -289,24 +348,27 @@ private fun DropZone( } @Composable -private fun ScaleSelector( - selectedScale: Int, - onScaleChange: (Int) -> Unit, +private fun SegmentedSelector( + label: String, + options: List, + selectedIndex: Int, + onSelect: (Int) -> Unit, ) { val haptic = LocalHapticFeedback.current val density = LocalDensity.current val fraction by animateFloatAsState( - targetValue = if (selectedScale == 2) 0f else 1f, + targetValue = selectedIndex.toFloat() / (options.size - 1).coerceAtLeast(1), animationSpec = tween(320, easing = FastOutSlowInEasing), label = "thumb_fraction", ) var trackWidth by remember { mutableFloatStateOf(0f) } val trackShape = RoundedCornerShape(18.dp) val thumbPadding = 6.dp + val segmentFraction = 1f / options.size Column { Text( - text = "SCALE MULTIPLIER", + text = label, style = MaterialTheme.typography.labelSmall, color = TextSecondary, modifier = Modifier.padding(bottom = 8.dp), @@ -322,12 +384,15 @@ private fun ScaleSelector( Box( modifier = Modifier - .fillMaxWidth(0.5f) + .fillMaxWidth(segmentFraction) .fillMaxHeight() .padding(thumbPadding) .offset( x = with(density) { - ((fraction * (trackWidth - 2 * thumbPadding.toPx())) / 2f).toDp() + ( + (fraction * (trackWidth - 2 * thumbPadding.toPx()) * (options.size - 1)) / + options.size + ).toDp() }, ) .clip(RoundedCornerShape(13.dp)) @@ -339,8 +404,8 @@ private fun ScaleSelector( .fillMaxSize() .selectableGroup(), ) { - listOf(2, 4).forEach { scale -> - val isSelected = selectedScale == scale + options.forEachIndexed { index, option -> + val isSelected = selectedIndex == index val segmentInteraction = remember { MutableInteractionSource() } val segmentFocused by segmentInteraction.collectIsFocusedAsState() val segmentShape = RoundedCornerShape(13.dp) @@ -361,13 +426,13 @@ private fun ScaleSelector( role = Role.RadioButton, onClick = { haptic.performHapticFeedback(HapticFeedbackType.TextHandleMove) - onScaleChange(scale) + onSelect(index) }, ), contentAlignment = Alignment.Center, ) { Text( - text = "${scale}×", + text = option, fontSize = if (isSelected) 21.sp else 17.sp, fontWeight = if (isSelected) FontWeight.ExtraBold else FontWeight.Medium, color = if (isSelected) OnPrimary else TextSecondary, @@ -379,6 +444,80 @@ private fun ScaleSelector( } } +@Composable +private fun ModelSelector( + models: List, + selectedModelId: String?, + onModelChange: (String) -> Unit, +) { + var expanded by remember { mutableStateOf(false) } + val selected = models.firstOrNull { it.id == selectedModelId } ?: models.first() + + Column { + Text( + text = "MODEL", + style = MaterialTheme.typography.labelSmall, + color = TextSecondary, + modifier = Modifier.padding(bottom = 8.dp), + ) + + Box(modifier = Modifier.fillMaxWidth()) { + GlassPanel(modifier = Modifier.fillMaxWidth()) { + Row( + modifier = Modifier + .fillMaxWidth() + .clickable(role = Role.DropdownList, onClickLabel = "Choose model") { expanded = true } + .padding(horizontal = 20.dp, vertical = 18.dp), + verticalAlignment = Alignment.CenterVertically, + ) { + Column(Modifier.weight(1f)) { + Text( + text = selected.name, + style = MaterialTheme.typography.bodyLarge, + color = TextPrimary, + ) + Text( + text = selected.allowedScales.joinToString(" ") { "${it}x" }, + style = MaterialTheme.typography.labelMedium, + color = TextSecondary, + ) + } + Text( + text = if (expanded) "▲" else "▼", + color = TextSecondary, + fontSize = 12.sp, + ) + } + } + + DropdownMenu( + expanded = expanded, + onDismissRequest = { expanded = false }, + modifier = Modifier.heightIn(max = 320.dp), + ) { + models.forEach { model -> + DropdownMenuItem( + text = { + Column { + Text(text = model.name) + Text( + text = model.allowedScales.joinToString(" ") { "${it}x" }, + style = MaterialTheme.typography.labelMedium, + color = TextSecondary, + ) + } + }, + onClick = { + onModelChange(model.id) + expanded = false + }, + ) + } + } + } + } +} + private fun formatSize(bytes: Long): String = when { bytes < 1024 -> "$bytes B" bytes < 1024 * 1024 -> "%.1f KB".format(bytes / 1024.0) diff --git a/app/src/main/java/com/sleepy/upscale/viewmodel/UpscaleViewModel.kt b/app/src/main/java/com/sleepy/upscale/viewmodel/UpscaleViewModel.kt index 2d10c5d..0fbf4fd 100644 --- a/app/src/main/java/com/sleepy/upscale/viewmodel/UpscaleViewModel.kt +++ b/app/src/main/java/com/sleepy/upscale/viewmodel/UpscaleViewModel.kt @@ -9,6 +9,11 @@ import android.provider.MediaStore import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.sleepy.upscale.UpscaleState +import com.sleepy.upscale.local.ImagePrep +import com.sleepy.upscale.local.LocalUpscaler +import com.sleepy.upscale.local.ModelDescriptor +import com.sleepy.upscale.local.ModelRegistry +import com.sleepy.upscale.local.Preflight import com.sleepy.upscale.network.ApiService import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job @@ -22,6 +27,11 @@ import kotlinx.coroutines.withContext import java.io.File import java.io.FileOutputStream +enum class Engine(val label: String) { + CLOUD("Cloud"), + LOCAL("On-device"), +} + class UpscaleViewModel : ViewModel() { private val _state = MutableStateFlow(UpscaleState.Idle) val state: StateFlow = _state.asStateFlow() @@ -29,6 +39,22 @@ class UpscaleViewModel : ViewModel() { private val _selectedScale = MutableStateFlow(2) val selectedScale: StateFlow = _selectedScale.asStateFlow() + private val _engine = MutableStateFlow(Engine.CLOUD) + val engine: StateFlow = _engine.asStateFlow() + + private val _selectedModelId = MutableStateFlow(ModelRegistry.BUNDLED_ID) + val selectedModelId: StateFlow = _selectedModelId.asStateFlow() + + val models: List = ModelRegistry.list() + + data class ImageMeta(val width: Int, val height: Int) + + private val _imageMeta = MutableStateFlow(null) + val imageMeta: StateFlow = _imageMeta.asStateFlow() + + private val _oversizeDialogVisible = MutableStateFlow(false) + val oversizeDialogVisible: StateFlow = _oversizeDialogVisible.asStateFlow() + private var upscaleJob: Job? = null private var downloadJob: Job? = null @@ -36,6 +62,19 @@ class UpscaleViewModel : ViewModel() { _selectedScale.value = scale } + fun setEngine(engine: Engine) { + _engine.value = engine + } + + fun setModel(modelId: String) { + _selectedModelId.value = modelId + } + + fun fullResVerdict(scale: Int): Preflight.FullResVerdict? { + val meta = _imageMeta.value ?: return null + return Preflight.evaluateFullRes(meta.width, meta.height, scale, Runtime.getRuntime().maxMemory()) + } + fun onImageSelected( context: Context, uri: Uri, @@ -51,8 +90,11 @@ class UpscaleViewModel : ViewModel() { val fileName = getFileName(context, uri) ?: "image.jpg" val bytes = context.contentResolver.openInputStream(uri)?.use { it.readBytes() } ?: throw Exception("Could not read image") + val dimensions = ImagePrep.readDimensions(context, uri) withContext(Dispatchers.Main) { + _imageMeta.value = dimensions?.let { ImageMeta(it.first, it.second) } + _oversizeDialogVisible.value = false _state.value = UpscaleState.ImageSelected( uri = uri, fileName = fileName, @@ -68,7 +110,81 @@ class UpscaleViewModel : ViewModel() { } } - fun startUpscale(context: Context) { + fun upscaleClicked(context: Context) { + if (_state.value !is UpscaleState.ImageSelected) return + if (_engine.value == Engine.CLOUD) { + startCloud(context) + return + } + val meta = _imageMeta.value + if (meta != null && Preflight.isOversize(meta.width, meta.height)) { + _oversizeDialogVisible.value = true + } else { + startLocal(context, ImagePrep.Mode.FULL_RES) + } + } + + fun chooseShrinkAndUpscale(context: Context) { + _oversizeDialogVisible.value = false + startLocal(context, ImagePrep.Mode.DOWNSCALE_FIT) + } + + fun chooseFullRes(context: Context) { + _oversizeDialogVisible.value = false + startLocal(context, ImagePrep.Mode.FULL_RES) + } + + fun chooseCloudOnce(context: Context) { + _oversizeDialogVisible.value = false + startCloud(context) + } + + fun dismissOversizeDialog() { + _oversizeDialogVisible.value = false + } + + fun cancelProcessing() { + upscaleJob?.cancel() + upscaleJob = null + if (_state.value is UpscaleState.Processing || _state.value is UpscaleState.Error) { + _state.value = UpscaleState.Idle + } + } + + private fun startLocal(context: Context, mode: ImagePrep.Mode) { + val currentState = _state.value as? UpscaleState.ImageSelected ?: return + val appContext = context.applicationContext + val scale = _selectedScale.value + + upscaleJob?.cancel() + upscaleJob = viewModelScope.launch(Dispatchers.Default) { + _state.value = UpscaleState.Processing("Preparing on-device upscale...", 0f) + + val result = LocalUpscaler.upscale(appContext, currentState.uri, scale, mode) { done, total, accelerator, progress -> + val stage = if (done == 0) { + "On-device · preparing" + } else { + "On-device · tile $done/$total · $accelerator" + } + _state.value = UpscaleState.Processing(stage, progress) + } + + result.fold( + onSuccess = { outcome -> + _state.value = UpscaleState.Completed( + imageBytes = outcome.bytes, + fileName = localOutputName(currentState.fileName, scale), + fileSize = outcome.bytes.size.toLong(), + ) + }, + onFailure = { error -> + _state.value = UpscaleState.Error("Upscale failed: ${error.message ?: "on-device processing error"}") + }, + ) + } + } + + private fun startCloud(context: Context) { val currentState = _state.value if (currentState !is UpscaleState.ImageSelected) return @@ -80,6 +196,7 @@ class UpscaleViewModel : ViewModel() { } val config = ApiService.getConfig() + if (!isActive) return@launch withContext(Dispatchers.Main) { _state.value = UpscaleState.Processing("Uploading image...", 0.3f) @@ -90,6 +207,7 @@ class UpscaleViewModel : ViewModel() { ?: throw Exception("Could not read image") val serverFilename = ApiService.uploadImage(config, imageBytes, currentState.fileName) + if (!isActive) return@launch withContext(Dispatchers.Main) { _state.value = UpscaleState.Processing("Upscaling ${_selectedScale.value}x...", 0.6f) @@ -136,6 +254,7 @@ class UpscaleViewModel : ViewModel() { } finally { creepJob.cancel() } + if (!isActive) return@launch val outputName = "upscaled_${_selectedScale.value}x_${currentState.fileName}" @@ -263,9 +382,19 @@ class UpscaleViewModel : ViewModel() { upscaleJob?.cancel() downloadJob?.cancel() _selectedScale.value = 2 + _oversizeDialogVisible.value = false + _imageMeta.value = null _state.value = UpscaleState.Idle } + override fun onCleared() { + upscaleJob?.cancel() + downloadJob?.cancel() + } + + private fun localOutputName(fileName: String, scale: Int): String = + "upscaled_${scale}x_" + fileName.substringBeforeLast('.', fileName) + ".jpg" + private fun getFileName(context: Context, uri: Uri): String? { val cursor = context.contentResolver.query(uri, null, null, null, null) cursor?.use { diff --git a/app/src/test/java/com/sleepy/upscale/local/PreflightTest.kt b/app/src/test/java/com/sleepy/upscale/local/PreflightTest.kt new file mode 100644 index 0000000..b4dbe69 --- /dev/null +++ b/app/src/test/java/com/sleepy/upscale/local/PreflightTest.kt @@ -0,0 +1,61 @@ +package com.sleepy.upscale.local + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +class PreflightTest { + + @Test + fun `estimate matches documented formula`() { + val estimate = Preflight.estimateRamBytes(1024, 1024, 4) + val inputPx = 1024L * 1024 + val outputPx = inputPx * 16 + assertEquals(inputPx * 4, estimate.inputBytes) + assertEquals(outputPx * 4, estimate.outputBytes) + val expectedTotal = ((inputPx + outputPx) * 4 * 2.0).toLong() + assertEquals(expectedTotal, estimate.totalBytes) + } + + @Test + fun `oversize trigger only beyond 1024 long edge`() { + assertFalse(Preflight.isOversize(1024, 1024)) + assertTrue(Preflight.isOversize(1025, 10)) + assertTrue(Preflight.isOversize(10, 2000)) + } + + @Test + fun `full res allowed within heap`() { + val verdict = Preflight.evaluateFullRes(256, 256, 2, maxHeapBytes = Long.MAX_VALUE) + assertTrue(verdict is Preflight.FullResVerdict.Allowed) + } + + @Test + fun `full res denied with reason beyond heap`() { + val verdict = Preflight.evaluateFullRes(4096, 4096, 4, maxHeapBytes = 64L shl 20) + assertTrue(verdict is Preflight.FullResVerdict.Denied) + assertTrue((verdict as Preflight.FullResVerdict.Denied).reason.contains("MB")) + } + + @Test + fun `fit dimensions shrink to cap for scale`() { + val (w, h) = Preflight.fitDimensions(inWidth = 3000, inHeight = 1500, scale = 4) + assertTrue(maxOf(w, h) * 4 <= Preflight.OUTPUT_CAP_PX) + assertEquals(1024, w) + assertEquals(512, h) + } + + @Test + fun `fit dimensions keeps small images untouched`() { + assertEquals(500 to 250, Preflight.fitDimensions(500, 250, scale = 4)) + } + + @Test + fun `fit dimensions preserves aspect ratio`() { + val (w, h) = Preflight.fitDimensions(4000, 1000, scale = 2) + assertEquals(2048, w) + assertEquals(512, h) + assertEquals(4.0f, w.toFloat() / h, 0.01f) + } +} diff --git a/app/src/test/java/com/sleepy/upscale/local/TilerTest.kt b/app/src/test/java/com/sleepy/upscale/local/TilerTest.kt new file mode 100644 index 0000000..3d5d611 --- /dev/null +++ b/app/src/test/java/com/sleepy/upscale/local/TilerTest.kt @@ -0,0 +1,138 @@ +package com.sleepy.upscale.local + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Test + +class TilerTest { + + @Test + fun `positions single window when image fits in tile`() { + assertEquals(listOf(0), Tiler.positions(100, 256, 16)) + assertEquals(listOf(0), Tiler.positions(256, 256, 16)) + } + + @Test + fun `positions cover full length without gaps`() { + for (length in 257..1400 step 7) { + val positions = Tiler.positions(length, 256, 16) + assertEquals("length $length", 0, positions.first()) + assertEquals("length $length", length - 256, positions.last()) + positions.sorted().zipWithNext { a, b -> + assertTrue("overlap violated at length $length", b - a < 256) + assertTrue("stride exceeded at length $length", b - a <= 240) + } + } + } + + @Test + fun `positions last window aligned to right edge`() { + val positions = Tiler.positions(600, 256, 16) + assertTrue(positions.contains(344)) + } + + @Test + fun `computeTiles covers every pixel of the image`() { + val width = 517 + val height = 300 + val grid = Tiler.computeTiles(width, height) + + val coverage = Array(height) { BooleanArray(width) } + grid.tiles.forEach { tile -> + val validW = minOf(grid.tileSize, width - tile.x) + val validH = minOf(grid.tileSize, height - tile.y) + for (y in tile.y until tile.y + validH) { + for (x in tile.x until tile.x + validW) { + coverage[y][x] = true + } + } + } + coverage.forEachIndexed { y, row -> + row.forEachIndexed { x, covered -> + assertTrue("pixel ($x, $y) uncovered", covered) + } + } + } + + @Test + fun `edge weights are opaque on boundary tiles and ramp inside`() { + val weights = Tiler.edgeWeights(origin = 0, size = 256, extent = 512, overlap = 16) + assertEquals(1f, weights.first(), 0.001f) + assertEquals(0f, weights.last(), 0.001f) + assertEquals(1f, weights[weights.size - 17], 0.001f) + } + + @Test + fun `edge weights fade on both sides for interior tiles`() { + val weights = Tiler.edgeWeights(origin = 240, size = 256, extent = 1024, overlap = 16) + assertEquals(0f, weights.first(), 0.001f) + assertEquals(1f, weights[16], 0.001f) + assertEquals(1f, weights[weights.size - 17], 0.001f) + assertEquals(0f, weights.last(), 0.001f) + } + + @Test + fun `edge weights never fade at true image edges`() { + val weights = Tiler.edgeWeights(origin = 768, size = 256, extent = 1024, overlap = 16) + assertEquals(1f, weights.last(), 0.001f) + } + + @Test + fun `extractTile replicates edge pixels outside bounds`() { + val width = 3 + val height = 2 + val source = intArrayOf( + 0xFF112233.toInt(), 0xFF445566.toInt(), 0xFF778899.toInt(), + 0xFFAABBCC.toInt(), 0xFFDDEEFF.toInt(), 0xFF010203.toInt(), + ) + val grid = TileGrid( + tiles = listOf(Tile(x = 0, y = 0)), + tileSize = 4, + imageWidth = width, + imageHeight = height, + ) + + val bytes = Tiler.extractTile(source, grid, Tile(0, 0)) + + assertEquals(4 * 4 * 4, bytes.size) + fun pixel(x: Int, y: Int): Int { + val o = (y * 4 + x) * 4 + return (bytes[o].toInt() and 0xFF) shl 16 or + ((bytes[o + 1].toInt() and 0xFF) shl 8) or + (bytes[o + 2].toInt() and 0xFF) + } + assertEquals(0x112233, pixel(0, 0)) + assertEquals(0x112233, pixel(1, 0)) + assertEquals(0x778899, pixel(2, 0)) + assertEquals(0x778899, pixel(3, 0)) + assertEquals(0xAABBCC, pixel(0, 3)) + assertEquals(0x010203, pixel(3, 3)) + } + + @Test + fun `blendTile overwrites with full weight and cross-fades partially`() { + val destination = IntArray(4).also { it.fill(0xFF000000.toInt()) } + val source = byteArrayOf( + 0x40.toByte(), 0x40.toByte(), 0x40.toByte(), 0xFF.toByte(), + 0x80.toByte(), 0x80.toByte(), 0x80.toByte(), 0xFF.toByte(), + ) + + Tiler.blendTile( + destination = destination, + destinationWidth = 2, + destinationHeight = 1, + source = source, + sourceWidth = 2, + sourceHeight = 1, + originX = 0, + originY = 0, + weightsX = floatArrayOf(0f, 0.5f), + weightsY = floatArrayOf(1f), + ) + + assertEquals(0xFF000000.toInt(), destination[0]) + val blended = destination[1] + val r = blended shr 16 and 0xFF + assertEquals(0x40, r) // 50% of 0x80 over 0x00 + } +} diff --git a/docs/Agents.md b/docs/Agents.md new file mode 100644 index 0000000..5b502bf --- /dev/null +++ b/docs/Agents.md @@ -0,0 +1,67 @@ +# Agents.md — guidance for AI coding agents on this repo + +## What this project is + +Android app (Kotlin + Jetpack Compose, minSdk 26, targetSdk 34) that upscales images. +Two engines: a legacy **cloud** path (scrapes iloveimg web API — fragile, frozen for +feature work) and an in-progress **on-device** path (Real-ESRGAN NCNN models via JNI), +specified in `docs/`. + +## Read order before touching anything + +1. `docs/prd.md` — goals, non-goals, user stories +2. `docs/architecture.md` — component design, threading, memory strategy +3. `docs/rules.md` — hard constraints (licensing, memory, git, a11y) +4. `docs/phases.md` — current phase + acceptance gates; keep checkboxes updated + +## Repo map (key files) + +``` +app/src/main/java/com/sleepy/upscale/ + MainActivity.kt edge-to-edge, theme host + UpscaleState.kt sealed state machine — DO NOT MODIFY for local feature + network/ApiService.kt cloud engine (FROZEN except bugfixes) + viewmodel/UpscaleViewModel.kt startUpscale(mode) dispatch point + ui/MainScreen.kt screen router inside GlassBackdrop + ui/screens/*.kt Upload / Processing / Download / Error + ui/components/Glass.kt glassmorphism component kit (backdrop, panel, button, tag) + ui/theme/{Color,Type,Theme}.kt dark liquid-glass token system + [planned] local/ LocalUpscaler, Tiler, ModelRegistry, NcnnBridge + [planned] cpp/ + CMakeLists JNI bridge to prebuilt ncnn +app/libs/ncnn/ vendored prebuilt ncnn android distribution (Phase 0) +gradle/libs.versions.toml version catalog — add deps here, not inline +``` + +## Environment facts + +- CI = GitHub Actions (`android-build.yml`): `assembleDebug` on push to main/master/dev, + PRs to main/master, or manual dispatch. Feature-branch pushes DO NOT build → validate via PR. +- Do not run Gradle locally unless explicitly asked; the user validates via CI. +- Signing: `keystore.properties` + root `upscale-release.jks` exist locally, git-ignored. + Never commit them; never reference absolute paths in committed files. + +## Locked decisions (do not relitigate without owner sign-off) + +- Engine: ncnn-first, single native engine. LiteRT/TFLite rejected after evaluation. +- Bundled model: `realesr-animevideov3-x4`. `general-x4v3` is banned (broken pnnx conversion). +- Output default cap: 4096 px long edge; bypass only via the oversize dialog's FullRes + option with preflight heap math. +- `UpscaleState` is reused as-is; progress strings carry tile info instead of new states. +- UI follows the dark liquid-glass system in `ui/` (semantic tokens only). + +## Working agreements + +- Implement phase-by-phase per `docs/phases.md`; finish a gate before opening the next. +- Pure logic (tiling, preflight) goes in testable Kotlin files with unit tests. +- All user-visible strings: concise, confident, no emojis. +- When adding dependencies use the version catalog; Compose artifacts ride the BOM. +- Reference implementations for the native layer are listed at the bottom of + `docs/architecture.md` — copy proven patterns, don't improvise JNI. + +## Verification checklist before handing back + +- [ ] `docs/phases.md` boxes updated +- [ ] New pure functions have unit tests +- [ ] No new raw color literals in composables +- [ ] Native/JNI changes return error codes and never throw across the boundary +- [ ] Commit pushed + PR opened if CI validation is needed diff --git a/docs/architecture.md b/docs/architecture.md new file mode 100644 index 0000000..d3e07cd --- /dev/null +++ b/docs/architecture.md @@ -0,0 +1,114 @@ +# Architecture — On-Device Upscaling (NCNN-first) + +## Current app (unchanged baseline) + +``` +MainActivity ─ MainScreen(GlassBackdrop) + ├─ UploadScreen (pick image, scale 2×/4×, engine toggle [new]) + ├─ ProcessingScreen(reuses Processing(stage, progress)) + ├─ DownloadScreen (preview + save via MediaStore) + └─ ErrorScreen +UpscaleViewModel: StateFlow · startUpscale() → ApiService (cloud only today) +``` + +Key invariant: **`UpscaleState` sealed class is NOT modified.** Local mode reuses +`Processing(stage, progress)` with stage strings like `"On-device · tile 214/740 · GPU"`. + +## Target architecture + +``` +UploadScreen + │ engine toggle: CLOUD | LOCAL model dropdown when LOCAL + ▼ +UpscaleViewModel.startUpscale(mode) mode ∈ {CloudOnce, DownscaleFit, FullRes} + │ + ├─ mode == CloudOnce ──────────────► existing ApiService flow (untouched) + │ + └─ LOCAL: + OversizeDialog decision already made in UI layer (see prd S3/S4) + │ + ▼ + LocalUpscaler (Kotlin, Dispatchers.IO single-thread executor) + ├─ ModelRegistry.resolve(selectedModelId) + ├─ BitmapUtils: decode → EXIF orientation fix → sRGB software bitmap → alpha flatten + ├─ Preflight (FullRes only): estimate outW*outH*4 vs heap → allow/deny earlier in dialog + ├─ Tiler.kt: pad to multiple of TILE, emit tiles (TILE=256, OVERLAP=16, feather blend) + ├─ per tile: NcnnBridge.upscaleTile(rgbaBytes, w, h) → rgbaBytes + │ progress → _state = Processing("On-device · tile n/N · GPU", n/N) + │ cancellation checked between tiles + ├─ stitch + crop padding → output Bitmap (long edge ≤ 4096 unless FullRes allowed) + └─ save via existing MediaStore code path +``` + +## Components + +### NcnnBridge (JNI, C++) + +- Native lib `libupscale_jni.so` built by CMake linking the **prebuilt ncnn Android + distribution** (GitHub `Tencent/ncnn` releases, `-android-vulkan` zip; 20260526 vendored, + see `app/libs/ncnn/VERSION.txt`), arm64-v8a + armeabi-v7a. +- API (all error-code based, never throws across JNI): + - `nativeInit(): Int` — once per process; returns gpu count (0 ⇒ CPU-only device). + - `nativeLoadModel(paramPath, binPath): Long` — handle; ncnn::Net cached per model. + - `nativeUpscaleTile(handle, rgba, w, h, useGpu): ByteArray?` — null on failure + (Vulkan failure ⇒ caller retries with CPU / disables GPU for remaining tiles). + - `nativeReleaseModel(handle)`. +- Bundled animevideov3 params are pnnx-style: input blob `"data"`, output blob `"output"`. +- Single-threaded use only. Vulkan device object owned by the bridge. + +### Tiler.kt (pure Kotlin) + +- Functions: `computeTiles(w,h,tile,overlap)`, `positions(length,tile,overlap)`, + `edgeWeights(origin,size,extent,overlap)`, `extractTile(...)` (replicate-fills edges so + every inference input is exactly TILE×TILE — no image padding or post-crop needed), + `blendTile(dst, src, ...)` feather-blends into the output pixel array. + All pure → unit-tested without Android. +- Feathered linear alpha ramp across the overlap margin to kill seams. + +### ModelRegistry + +``` +filesDir/models//model.param + model.bin (+ meta.json {name, scales[], license, source}) +assets/models/animevideov3/realesr-animevideov3-x{2,4}.{param,bin} + meta.json (bundled fallback, always present) +``` + +- Descriptor: `{ id, name, allowedScales[], format: NCNN, source: BUNDLED|DOWNLOADED|IMPORTED }`. +- Allowed-scales mirrors AIU's `FIXED_SCALE_MODELS`: animevideov3 ships separate x2/x3/x4 files; + x4plus-family is x4-only. +- Import accepts `.zip` containing param+bin or both files picked individually. +- Malformed models: load failure ⇒ descriptor flagged disabled in UI, app continues. + +### Preflight calculator + +`estimateRam(outW,outH) = (inPx + outPx) * 4 * HEADROOM(2.0)` compared against +`Runtime.maxMemory()` (largeHeap enabled in manifest). Dialog greys "Full resolution" +with reason when estimate exceeds available heap. + +## Memory strategy + +| Mode | Input transform | Output cap | +|---|---|---| +| DownscaleFit (default/recommended) | shrink so ×4 output long edge ≤ 4096 | hard 4096 | +| FullRes (bypass) | none | bounded by preflight heap math | + +Rationale: bitmaps are RGBA_8888; 4096-long-edge worst case ≈ 67 MB output — safe on all +supported devices; 8192 ≈ 270 MB — not. + +## Threading rules + +- Exactly one inference thread (`newSingleThreadContext("ncnn")`). GPU context is not thread-safe. +- Cancellation is cooperative: checked between tiles; model released on scope end/clear(). +- Never decode >1024 px-scale work on Main. UI observes StateFlow only. +## Cloud interplay + +`ApiService.kt` is frozen for this feature. The oversize dialog's cloud option simply +calls the existing cloud branch for that one job; the engine toggle preference is not +mutated. The dialog's cloud option is gated on connectivity (`network/Connectivity.kt`, +VALIDATED capability). + +## Reference implementations (do-not-reinvent list) + +- `tumuyan/RealSR-NCNN-Android`, `Celesth/MatUnCNN` — JNI patterns, model folder layout. +- `IbrahimGhadre/realesrgan-mobile` — NCNN JNI benchmark reference (~152 ms/tile class). +- `xinntao/Real-ESRGAN-ncnn-vulkan` — canonical CLI flags & tiling semantics. +- `Zushikina-kun/AIU-Image-AI-Upscaler` — product behavior reference (folder scan, FIXED_SCALE_MODELS). diff --git a/docs/phases.md b/docs/phases.md new file mode 100644 index 0000000..81cdc16 --- /dev/null +++ b/docs/phases.md @@ -0,0 +1,62 @@ +# Phases — On-Device Upscaling Roadmap + +Branch: `feature/ncnn-local-upscale` +Each phase ends with a commit + CI-green check (push branch → open PR to main, since +branch pushes don't trigger CI). + +--- + +## Phase 0 — Spike (1 session) + +Goal: prove the native path end-to-end on one tile. + +- [x] Download ncnn android-vulkan prebuilt zip; vendor under `app/libs/ncnn/` (arm64-v8a + armeabi-v7a) — ncnn 20260526, VERSION.txt records source +- [x] Enable NDK/CMake in `app/build.gradle.kts`; `CMakeLists.txt` linking libncnn +- [x] `NcnnBridge.kt` + `app/src/main/cpp/upscale_jni.cpp`: init/loadModel/upscaleTile/release +- [x] Bundle `animevideov3-x4` param+bin into assets (also bundles x2; matches the 2×/4× selector) +- [x] Debug-only smoke screen: pick image → upscale ONE 256px tile → show before/after ("Engine self-check" entry, BuildConfig.DEBUG only) +- [x] Log ms/tile for GPU and CPU paths + +**EXIT GATE:** an upscaled tile renders on-device. Code complete — pending on-device validation via PR build. + +## Phase 1 — MVP (2–4 sessions) + +- [x] Engine toggle UI (`Cloud | On-device`) on UploadScreen; model dropdown (bundled only) +- [x] Oversize dialog with 3 options + live RAM estimates (prd S3/S4) + - preflight estimator · grey-out impossible FullRes · connectivity gate on cloud option +- [x] `android:largeHeap="true"` +- [x] Full pipeline: decode→EXIF→sRGB→alpha-flatten→pad→tile→infer→feather-blend→crop→save + (padding/crop replaced by replicate-filled fixed tiles; see architecture.md) +- [x] Progress via existing Processing state ("On-device · tile n/N · GPU|CPU") + cancel button wiring +- [x] Output cap 4096 long edge enforced in DownscaleFit mode +- [x] Fixtures/tests: tiler unit tests (coverage, seams, blending), preflight unit tests; + EXIF rotation / P3 / alpha PNG handled in ImagePrep — device QA checklist for PR +- [x] Benchmark logger (debug builds): ms/tile per device + +**ACCEPTANCE:** camera photo in → correct-side-up sharp ×4 out; low-RAM profile survives; +CPU-fallback exercised; no regression in cloud flow. Code complete — pending on-device +validation via PR build. + +## Phase 2 — Model manager (1–2 sessions) + +- [ ] Registry scan of `filesDir/models/*` (+ meta.json), merged with bundled list +- [ ] Downloads from our GitHub Releases (packs we publish; license-filtered BSD/MIT/CC-BY only) +- [ ] Custom import via SAF picker (.zip or param+bin pair) — AIU parity +- [ ] Malformed-model guard: load failure flags entry disabled; app never crashes +- [ ] Storage management screen (size, delete) + +**ACCEPTANCE:** a third-party Upscayl/OpenModelDB NCNN model imports and runs end-to-end. + +## Phase 3 — Polish (1–2 sessions) + +- [ ] Sharpen presets post-pass (Photo / Anime / Art / Strong) + sharpen-only action +- [ ] Output format picker JPEG/WebP/PNG + quality (parametrize hardcoded MIME) +- [ ] 2-pass chaining (sequential registry runs) +- [ ] "Remember my choice" preference for the oversize dialog +- [ ] Adaptive output cap probe (6144 px on high-RAM flagships) +- [ ] GPU/CPU mode badge + measured-rate ETA polish + +## Parked (explicitly out of scope) + +Background removal · YOLO smart-crop · background batch (WorkManager) · compare slider · +cloud backend replacement (iloveimg scraping risk tracked separately) · trial/tier monetization. diff --git a/docs/prd.md b/docs/prd.md new file mode 100644 index 0000000..9aff63f --- /dev/null +++ b/docs/prd.md @@ -0,0 +1,76 @@ +# PRD — On-Device AI Upscaling + +Status: APPROVED (plan finalized 2026-08) +Owner: sleepy-snowflake +Origin: GitHub issue #1 (integration request inspired by AIU-Image-AI-Upscaler) + +## Problem + +Upscale currently works only through the iloveimg web API: + +1. The client scrapes `iloveimg.com/upscale-image` HTML for tokens — fragile, can break any time, possible ToS exposure. +2. Every upscale uploads the user's photo to a third party (privacy). +3. Progress is fake during server processing; results feel frozen then sudden. +4. No offline capability at all. + +Issue #1 asks for capabilities of a desktop tool (AIU) whose core appeal is +**many swappable AI models** plus image-enhancement extras. + +## Goals + +1. G1 — Offline, private, on-device upscaling via Real-ESRGAN-family NCNN models. +2. G2 — Model plurality: bundled model + downloadable packs + **user-imported `.param/.bin`** (AIU parity). +3. G3 — Honest UX: real per-tile progress, GPU/CPU mode badge, measured ETA. +4. G4 — Safe resource behavior on low-RAM phones (never crash on big photos). +5. G5 — Keep the existing cloud path fully functional as fallback. + +## Non-goals (parked) + +- Background removal (rembg / U²-Net ~170 MB). +- YOLOv8 smart-crop. +- Background batch processing (WorkManager) and compare slider. +- Replacing the cloud backend with a paid API (separate future track). +- "Trial version" monetization — product decision, no code impact now. + +## User stories + +| ID | Story | +|---|---| +| S1 | As a user, I can pick **Cloud / On-device** before upscaling. | +| S2 | As a user with no internet, I can still upscale small images offline. | +| S3 | When my photo exceeds local limits (>1024 px long edge), I get three explicit choices: shrink-and-upscale (recommended), use cloud once, or attempt full resolution anyway with live RAM estimates. | +| S4 | Full-resolution attempts that mathematically cannot fit are greyed out with the reason shown — never a silent crash. | +| S5 | I can watch tile-by-tile progress with an honest time estimate. | +| S6 | I can cancel processing between tiles at any moment. | +| S7 | I can add my own NCNN model (zip or param+bin pair) and see it in the model list if it is well-formed; malformed models are flagged, never crashing the app. | +| S8 | I can sharpen/enhance results using presets (Photo / Anime / Art / Strong) after upscaling. | +| S9 | Results save through the same Downloads flow as today, in JPEG/WebP/PNG (Phase 3). | + +## Feature parity vs AIU (desktop reference) + +| AIU feature | Here | Phase | +|---|---|---| +| Real-ESRGAN 2×–4×, offline | Yes | 0–1 | +| Multiple models + custom `.param/.bin` | Yes (registry + import) | 2 | +| Sharpen presets / sharpen-only | Yes | 3 | +| Pre-processing (auto-levels etc.) | Partial (later polish) | 3+ | +| 2-pass model chaining | Yes (sequential registry runs) | 3 | +| Output format/quality/filename | Yes | 3 | +| EXIF preservation | Input-side handled (orientation); output metadata later | 1 / 3+ | +| Batch queue | Parked | — | +| TTA mode | Never (4× slower, negligible gain) | — | +| Background removal, YOLO crop | Parked / likely never | — | + +## Success criteria + +- Camera photo → correct-side-up sharp ×4 output, no crash on a low-RAM device profile. +- CPU-fallback path exercised and usable (slow but honest about it). +- A community Upscayl/OpenModelDB NCNN model imports and runs (Phase 2 gate). +- CI stays green; unit tests cover all pure tiling/preflight math. + +## Constraints & decisions locked + +- Engine: **NCNN-first** (prebuilt Android zip, Vulkan ON + CPU fallback). LiteRT path dropped. +- Bundled model: `realesr-animevideov3-x4` (official ncnn files; `general-x4v3` excluded — known broken pnnx conversion produces black output). +- Local output capped at **4096 px long edge by default**, surfaced via the oversize dialog rather than silent shrinking. +- Cloud code (`ApiService`) remains untouched by this feature except for one-shot routing from the dialog. diff --git a/docs/rules.md b/docs/rules.md new file mode 100644 index 0000000..513ae6e --- /dev/null +++ b/docs/rules.md @@ -0,0 +1,45 @@ +# Rules — non-negotiable engineering constraints + +## Licensing +1. Only ship/import model weights whose license is BSD / MIT / Apache / CC-BY. + **Never** CC-BY-NC or unlicensed files. Record the license in each model's `meta.json`. +2. Never commit third-party code without noting its source repo in the file header docs. +3. Vendored ncnn binaries: keep version + source URL recorded next to the libs. + +## Secrets & git +4. `*.jks`, `*.keystore`, `keystore.properties`, PATs/tokens — never committed, ever. + `.gitignore` already guards these; do not weaken it. +5. Never paste credentials into source, docs, or CI logs (mask when echoing). +6. Commit style: short lowercase imperative summary matching repo history + (`fix: ...`, `dark liquid-glass theme: ...`). + +## Memory & safety +7. Any new bitmap allocation must state its worst-case size in review; anything that can + exceed ~100 MB requires a preflight check or cap. The 4096 default cap may only be + bypassed through the FullRes dialog path with preflight approval. +8. Native calls return error codes; JNI must never let C++ exceptions escape. + A malformed user-supplied model may disable itself but must not crash the process. +9. Inference runs on the dedicated single thread only; cancellation is checked between + tiles; no blocking waits on Main. + +## Cloud boundary +10. `network/ApiService.kt` is frozen during local-upscale work — bug fixes allowed, + feature changes need explicit approval (it's the fragile scraping path). +11. Local mode must work with airplane mode on: no network calls anywhere in the LOCAL branch. + +## Code conventions +12. Follow existing style: semantic design tokens (no raw hex in composables), explicit + interaction states, no comments unless genuinely non-obvious, Kotlin official style. +13. UI text tone: concise, confident, helpful — see glassmorphism skill foundations. +14. Accessibility floor (WCAG 2.2 AA): 4.5:1 text contrast, visible focus rings on every + interactive element, roles via semantics, ≥48 dp touch targets. + +## Testing +15. Tiler/preflight math = pure functions with unit tests (no Robolectric needed). +16. Every phase closes with CI green (`assembleDebug`). Branch pushes don't trigger CI — + use PRs to main for validation. +17. Debug builds carry the benchmark logger; never ship timing logs in release. + +## Docs +18. Update `docs/phases.md` checkboxes as work completes; material architecture changes + update `docs/architecture.md` in the same PR. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ef4e9bd..dbffada 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,6 +7,8 @@ lifecycle = "2.8.5" okhttp = "4.12.0" compose-bom = "2024.09.00" coil = "2.6.0" +exifinterface = "1.3.7" +junit = "4.13.2" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -14,7 +16,9 @@ androidx-activity-ktx = { group = "androidx.activity", name = "activity-ktx", ve androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycle" } androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" } lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle" } +androidx-exifinterface = { group = "androidx.exifinterface", name = "exifinterface", version.ref = "exifinterface" } okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" } +junit = { group = "junit", name = "junit", version.ref = "junit" } compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" } compose-ui = { group = "androidx.compose.ui", name = "ui" }